Use
the ui:markup tag
to insert any type of XML markup
in the rendered HTML page. The ui:markup
tag allows you to insert HTML
elements into the JSP page where HTML is not permitted inside a JSF
tag.
Configuring
the markup tag
Use
the tag
attribute to specify the type of
HTML element to insert. For instance, to insert a <p>
tag, set the attribute to tag="p"
in the ui:markup
tag. Note that you do not
include the angle brackets.
If
the HTML element you are
inserting is a singleton element, you must specify the singleton
attribute. The singleton attribute causes the trailing
/>
to be generated in the rendered HTML. For example, the <br>
element is a singleton element, which must be rendered as <br
/> to be XHTML
compliant.
If
you want to specify
additional HTML attributes for the element you are inserting, use the extraAttributes
attribute.
HTML
Elements and Layout
The
rendered HTML page includes
the HTML element that was specified in the ui:markup tag's tag attribute, along with
any HTML
attributes that were included in the extraAttributes
attribute.
Theme
Identifiers
None.
Client
Side Javascript
Functions
None.
Examples
Example
1: Insert a
singleton element
<ui:markup tag="br" singleton="true" />
This
generates <br
/> .
Example
2: Insert a <div>
element with a style attribute
<ui:markup
tag="div"
style="color:blue" />
This
generates <div
style="color:blue" >
Example
3: Insert a <h3>
with HTML attributes
<ui:markup tag="h3" extraAttributes="onclick='alert("foobar");'" > <ui:staticText text="Example" /> </ui:markup>
This generates a
level 3 head titled Example that
will display the alert with "foobar" in it when clicked.
Auto-generated component class.
Do NOT modify; all changes
will be lost!
|