| com.sun.rave.web.ui.component.ScriptBase
All known Subclasses: com.sun.rave.web.ui.component.Script,
ScriptBase | abstract public class ScriptBase extends javax.faces.component.UIComponentBase (Code) | | Use the ui:script tag to create a <script> element in the rendered
HTML page.
The ui:script tag must be used within
the ui:head tag, or within the ui:body tag. The ui:script tag can be used to
refer to a
Javascript file, by using the url attribute. The tag can also be used
embed Javascript code within the rendered HTML page.
The
client-side script allows
you to perform some interactive functions such as input checking before
the page is submitted.
HTML
Elements and Layout
The rendered HTML page
contains a <script>
element with any attributes
specified through the ui:script
tag attributes.
Theme
Identifiers
None.
Client
Side Javascript Functions
None.
Example
Example
1: Create a script tag to a file
<ui:script url="/pathtomyjs/myjavascript.js" />
Example
2: Create a script tag with embedded script (Not Recommended)
<ui:script>
<f:verbatim>
function foo(text) {
alert(text);
}
</f:verbatim>
</ui:script>
Note: If the embeded script includes characters like "<" or "&", the script
code should be placed in an external file (see Example 1).
Auto-generated component class.
Do NOT modify; all changes
will be lost!
|
Method Summary | |
public String | getCharset() Defines the character (charset) encoding of the target URL. | public String | getFamily() Return the identifier of the component family to which this
component belongs. | public String | getType() Indicates the MIME type of the script. | public String | getUrl() Defines the absolute or relative URL to a file that contains the
script. | public void | restoreState(FacesContext _context, Object _state) | public Object | saveState(FacesContext _context) | public void | setCharset(String charset) Defines the character (charset) encoding of the target URL. | public void | setType(String type) Indicates the MIME type of the script. | public void | setUrl(String url) Defines the absolute or relative URL to a file that contains the
script. |
ScriptBase | public ScriptBase()(Code) | | Construct a new ScriptBase .
|
getCharset | public String getCharset()(Code) | | Defines the character (charset) encoding of the target URL.
See iana.org for a complete list of character encodings.
|
getFamily | public String getFamily()(Code) | | Return the identifier of the component family to which this
component belongs. This identifier, in conjunction with the value
of the rendererType property, may be used to select
the appropriate
Renderer for this component instance.
|
getType | public String getType()(Code) | | Indicates the MIME type of the script. Default is "text/javascript"
|
getUrl | public String getUrl()(Code) | | Defines the absolute or relative URL to a file that contains the
script. Use this attribute to refer to a file instead of inserting the
script into your HTML document
|
restoreState | public void restoreState(FacesContext _context, Object _state)(Code) | | Restore the state of this component.
|
saveState | public Object saveState(FacesContext _context)(Code) | | Save the state of this component.
|
setCharset | public void setCharset(String charset)(Code) | | Defines the character (charset) encoding of the target URL.
See iana.org for a complete list of character encodings.
See Also: ScriptBase.getCharset() |
setUrl | public void setUrl(String url)(Code) | | Defines the absolute or relative URL to a file that contains the
script. Use this attribute to refer to a file instead of inserting the
script into your HTML document
See Also: ScriptBase.getUrl() |
|
|