META-INF.html_basic.tld Maven / Gradle / Ivy
Show all versions of jboss-jsf-api_2.3_spec Show documentation
This tag library contains JavaServer Faces component tags for all
UIComponent + HTML RenderKit Renderer combinations defined in the
JavaServer Faces Specification.
2.1
h
http://java.sun.com/jsf/html
com.sun.faces.taglib.html_basic.HtmlBasicValidator
Renders an HTML "input"
element.
Decode Behavior
Obtain the Map
from the "requestParameterMap"
property of the ExternalContext
. If the value in the
Map
for the value of the "clientId" property of the
component is null
, create a String by concatenating
the value of the "clientId" property of the component with the
String ".x" (without the quotes). Create another String in the
same manner, but concatenate ".y" (without the quotes). If
null
is the value in the Map
for both
Strings, return from decode()
. If the value in the
Map
for the value of the "clientId" property of the
component is not null
, get the value of the "type"
attribute, and convert it to lower case. If the result is equal
to the String "reset" (without the quotes), return from
decode()
. Otherwise, create a
javax.faces.event.ActionEvent
around the component,
and pass it to the queueEvent()
method of the
component, which must be an instance of
UICommand
.
Encode Behavior
Render the clientId of the component as the value of the "name"
attribute. Render the current value of the component as the value
of the "value" attribute. If "image" attribute is specified render
it as the value of the "src" attribute after passing it to the
getResourceURL()
method of the
ViewHandler
for this application, and passing the
result through the encodeResourceURL()
method of the
ExternalContext
. Note that calling
getResourceURL()
will prefix the context-root of the
current application if the value of the "src" attribute starts
with "/". When handling the "image" attribute, the value
must not be escaped. For example, &
must not be
turned into &
. If the "styleClass" attribute
is specified, render its value as the value of the "class"
attribute. If the user has specified an "onclick" attribute,
append that JavaScript to any existing JavaScript already being output by the
implementation before rendering.
If the component being rendered by
this renderer has any UIParameter
children, each one
of them must be rendered using the renderer for component-family:
"javax.faces.Input" and renderer-type: "javax.faces.Hidden". For
discussion, this is called the hiddenRenderer. A component with
component-type "javax.faces.Input" must be created for local use
in rendering each UIParameter
child. The "id"
property of the temporary component must be set to the "name" of
the UIParameter
. The "value" property of the
temporary component must be set to the "value" of the
UIParameter
. For each UIParameter
child, the hiddenRenderer must have its
encodeBegin()
, encodeChildren()
, and
encodeEnd()
methods called, in order, passing the
temporary component as the second argument.
Because this renderer is responsible for rendering its own
children, the renderer will decide if the end tag is required or
not based on the presence or absence of children for the
component.
To support entering flows that are defined by both a defining
document id and a flow id, add a component attribute to this
component whose name is given by the value of the symbolic
constant
javax.faces.event.ActionListener.TO_FLOW_DOCUMENT_ID_ATTR_NAME
,
and whose value is the defining document id. For example, when
using this component in a facelet page, the following markup
would cause such an attribute to be added.
<h:commandButton id="start_a" value="enter flow-a" action="flow-a">
<f:attribute name="to-flow-document-id" value="unique"/>
</h:commandButton>
]]>
commandButton
com.sun.faces.taglib.html_basic.CommandButtonTag
JSP
action
false
java.lang.Object action()
MethodExpression representing an action listener method that
will be notified when this component is activated by the user.
The expression must evaluate to a public method that takes an
ActionEvent parameter, with a return type of void, or to a public method that takes no
arguments with a return type of void. In the latter case, the
method has no way of easily knowing where the event came from,
but this can be useful in cases where a notification is needed
that "some action happened".
]]>
actionListener
false
void actionListener(javax.faces.event.ActionEvent)
id
false
true
immediate
false
boolean
rendered
false
boolean
value
false
java.lang.Object
accesskey
false
java.lang.String
alt
false
java.lang.String
dir
false
java.lang.String
disabled
false
boolean
Absolute or relative URL of the
image to be displayed for this
button. If specified, this
"input" element will be of type
"image". Otherwise, it will be
of the type specified by the
"type" property with a label
specified by the "value"
property. Note
that if the value of this
attribute starts with "/", the
rendered value for this
attribute will be prefixed with
the context-root for this
application.
]]>
image
false
java.lang.String
label
false
java.lang.String
lang
false
java.lang.String
onblur
false
java.lang.String
onchange
false
java.lang.String
onclick
false
java.lang.String
ondblclick
false
java.lang.String
onfocus
false
java.lang.String
onkeydown
false
java.lang.String
onkeypress
false
java.lang.String
onkeyup
false
java.lang.String
onmousedown
false
java.lang.String
onmousemove
false
java.lang.String
onmouseout
false
java.lang.String
onmouseover
false
java.lang.String
onmouseup
false
java.lang.String
onselect
false
java.lang.String
readonly
false
boolean
Per the WAI-ARIA spec and its
relationship to HTML5 (Section title ARIA Role Attriubute),
every HTML element may have a "role" attribute whose value
must be passed through unmodified on the element on which it
is declared in the final rendered markup. The attribute, if
specified, must have a value that is a string literal that is,
or an EL Expression that evaluates to, a set of
space-separated tokens representing the various WAI-ARIA roles
that the element belongs to.
It is the page author's
responsibility to ensure that the user agent is capable of
correctly interpreting the value of this attribute.
]]>
role
false
java.lang.String
style
false
java.lang.String
styleClass
false
java.lang.String
tabindex
false
java.lang.String
title
false
java.lang.String
type
false
java.lang.String
The ValueExpression linking this component to a property in a backing bean
binding
false
javax.faces.component.UIComponent
Render an HTML "a" anchor
element that acts like a form submit button when
clicked.
General Behaviour
Both the encode and decode behavior require the ability to get
the id/name for a hidden field, which may be rendered in markup or which
may be programmatically added via client DOM manipulation,
whose value is set by the JavaScript form submit. This name must
be constructed as follows:
Get the clientId for the form of which this component is a
child.
Append
NamingContainer.SEPARATOR_CHAR
.
Append a constant string that is the same for all command
link components in the tree.
In the following text, this String is called
hiddenFieldName.
Decode Behavior
Obtain the "clientId" property of the component. Obtain the
Map
from the "requestParameterMap" property of the
ExternalContext
. Derive hiddenFieldName as above.
Get the entry in the Map
under the key that is the
hiddenFieldName. If the there is no entry, or the entry is the
empty String, or the entry is not equal to the value of the
"clientId" property, return immediately. If there is an entry,
and its value is equal to the value of the "clientId" property,
create a new javax.faces.event.ActionEvent
instance
around the component and call queueActionEvent()
on
the component, passing the event.
Encode Behavior
If the value of the disabled
attribute is
true
, render a span element. Render all the
ignored-by-renderer attributes and the target
attribute as ignored-by-renderer attributes on the span, even
though the target
attribute will have no effect on a
span. Render the current value of the component as the content of
the span. Return.
If the disabled
attribute is not present, or its
value is false
, render an HTML a
element. Render "#" as the value of the "href" attribute. Render
the current value of the component as the link text if it is
specified. Render JavaScript that is functionally equivalent to
the following as the value of the "onclick" attribute:
document.forms['CLIENT_ID']['hiddenFieldName'].value='CLIENT_ID';
document.forms['CLIENT_ID']['PARAM1_NAME'].value='PARAM1_VALUE';
document.forms['CLIENT_ID']['PARAM2_NAME'].value='PARAM2_VALUE';
document.forms['CLIENT_ID'].submit(); return false;
where hiddenFieldName is as described above, CLIENT_ID is the
clientId of the UICommand component, PARAM*_NAME and PARAM*_VALUE
are the names and values, respectively, of any nested UIParameter
children. The name and the value must be URLEncoded. Note that the required url
encoding is handled by
ResponseWrter.writeAttribute()
. If an
"onclick" attribute was specified by the user, render this
JavaScript in a function, and render the user's JavaScript in a
function. Render both functions in a choice function as
follows:
var a=function(){#USER_FUNCTION#};
var b=function(){#JSF_FUNCTION#};
return (a()==false) ? false : b();
where #USER_FUNCTION# is the user's JavaScript and
#JSF_FUNCTION# is the JavaScript rendered by JSF. The choice
function should operate such that if the user's JavaScript returns
true, then the rendered JavaScript will also execute.
If the "styleClass" attribute is specified, render its value as
the value of the "class" attribute. Render any non-UIParameter
output children as normal inside of the "a" element. These will
appear as the link text. Allow the form renderer to output a
single "input" element (for the entire page, regardless of how
many command link components are in the page) of "type" "hidden"
whose "name" is the value of hiddenFieldName, and which must not
have a "value" attribute. Multiple occurrences of command link
components in the tree should not cause multiple hiddenFieldName
hidden fields. Allow the form renderer to output an "input"
element of "type" "hidden" for each of the nested UIParameter
children, taking the name property (but not the value) from each
one in turn. If the "disabled" attribute is specified, do not
render the HTML "a" anchor element or its "href" attribute.
Instead, render a "span" element. If the "styleClass" attribute
is specified, render its value as the value of the "class"
attribute on the "span". Render any ignored-by-renderer attributes on
the "span". The content of the span element comes from the value
of the component or its children as specified above.
If the user specified a target
attribute, its
value must be set using javascript since the onclick
handler will prevent the target attribute from being generated.
This must be accomplished using JavaScript that is equivalent to
the following.
document.forms['CLIENT_ID'].target='TARGET';
Where TARGET is the value of the target attribute on the JSP
tag.
To support entering flows that are defined by both a defining
document id and a flow id, add a component attribute to this
component whose name is given by the value of the symbolic
constant
javax.faces.event.ActionListener.TO_FLOW_DOCUMENT_ID_ATTR_NAME
,
and whose value is the defining document id. For example, when
using this component in a facelet page, the following markup
would cause such an attribute to be added.
<h:commandLink id="start_a" value="enter flow-a" action="flow-a">
<f:attribute name="to-flow-document-id" value="unique"/>
</h:commandLink>
]]>
commandLink
com.sun.faces.taglib.html_basic.CommandLinkTag
JSP
action
false
java.lang.Object action()
MethodExpression representing an action listener method that
will be notified when this component is activated by the user.
The expression must evaluate to a public method that takes an
ActionEvent parameter, with a return type of void, or to a public method that takes no
arguments with a return type of void. In the latter case, the
method has no way of easily knowing where the event came from,
but this can be useful in cases where a notification is needed
that "some action happened".
]]>
actionListener
false
void actionListener(javax.faces.event.ActionEvent)
id
false
true
immediate
false
boolean
rendered
false
boolean
value
false
java.lang.Object
accesskey
false
java.lang.String
charset
false
java.lang.String
coords
false
java.lang.String
dir
false
java.lang.String
disabled
false
boolean
hreflang
false
java.lang.String
lang
false
java.lang.String
onblur
false
java.lang.String
onclick
false
java.lang.String
ondblclick
false
java.lang.String
onfocus
false
java.lang.String
onkeydown
false
java.lang.String
onkeypress
false
java.lang.String
onkeyup
false
java.lang.String
onmousedown
false
java.lang.String
onmousemove
false
java.lang.String
onmouseout
false
java.lang.String
onmouseover
false
java.lang.String
onmouseup
false
java.lang.String
rel
false
java.lang.String
rev
false
java.lang.String
Per the WAI-ARIA spec and its
relationship to HTML5 (Section title ARIA Role Attriubute),
every HTML element may have a "role" attribute whose value
must be passed through unmodified on the element on which it
is declared in the final rendered markup. The attribute, if
specified, must have a value that is a string literal that is,
or an EL Expression that evaluates to, a set of
space-separated tokens representing the various WAI-ARIA roles
that the element belongs to.
It is the page author's
responsibility to ensure that the user agent is capable of
correctly interpreting the value of this attribute.
]]>
role
false
java.lang.String
shape
false
java.lang.String
style
false
java.lang.String
styleClass
false
java.lang.String
tabindex
false
java.lang.String
target
false
java.lang.String
title
false
java.lang.String
type
false
java.lang.String
The ValueExpression linking this component to a property in a backing bean
binding
false
javax.faces.component.UIComponent
Renders an HTML "table" element
compliant with the HTML 401 specification. Render the "caption"
facet, if present, inside a "caption" element immediately below
the "table" element. If the "captionClass" attribute is
specified, render its value as the value of the "class" attribute
on the "caption" element. If the "captionStyle" attribute is
specified, render its value as the value of the "style" attribute
on the "caption" element. Please consult the javadoc for
UIData
to supplement this specification. If the
"styleClass" attribute is specified, render its value as the value
of the "class" attribute on the "table" element. Any
ignored-by-renderer attributes are also rendered on the "table"
element.
Column Groups
If the UIData
component has a "colgroups" facet,
render its contents. Consistent with the rules of facets in
general, this facet must have only one child. In general, this
will be a panel group
component that will contain
colgroup
and col
elements per the HTML
Table specification. Use of column grouping can improve
accessibility. This facet must be rendered before the table
header and footer.
Rendering the header
If the UIData
component has a "header" facet, or
any of the child UIColumn
components has a "header"
facet, render a "thead" element. If the UIData
component has a "header" facet, encode its contents inside of "tr"
and "th" elements, respectively. Output the value of the
"headerClass" attribute of the UIData
component, if
present, as the value of the "class" attribute on the "th".
Output the number of child UIColumn
components of the
UIData
component as the value of the "colspan"
attribute on the "th". Output "colgroup" as the value of the
"scope" attribute on the "th" element.
If any of the child UIColumn
components has a
"header" facet render a "tr" element. For each
UIColumn
that actually has a "header" facet, render
it inside of a "th" element. Columns that don't have a "header"
facet cause an empty "th" element to be rendered. Output the
value of the "headerClass" attribute of the UIColumn
component, if present, as the value of the "class" attribute on
the "th". If the "headerClass" attribute of the UIColumn
component is not present, output the value of the "headerClass"
attribute of the UIData
component, if present, as
the value of the "class" attribute on the "th". Output "col" as
the value of the "scope" attribute on the "th" element.
Close out the "thead" element.
Rendering the footer
If the UIData
component has a "footer" facet, or
any of the child UIColumn
components has a "footer"
facet, render a "tfoot" element. If the UIData
component has "footer" facets, encode the contents inside of a "tr"
element.
If any of the child UIColumn
components has a
"footer" facet render a "td" element. For each
UIColumn
that actually has a "footer" facet, render
it inside of a "td" element. Columns that don't have a "footer"
facet cause an empty "td" element to be rendered. Output the
value of the "footerClass" attribute of the UIColumn
component, if present, as the value of the "class" attribute on
the "td". If the "footerClass" attribute of the UIColumn
component is not present, output the value of the "footerClass"
attribute of the UIData
component, if present, as
the value of the "class" attribute on the "td".
If the UIData
component has a "footer" facet,
encode its contents inside of "tr" and "td" elements, respectively.
Output the value of the "footerClass" attribute of the
UIData
component, if present, as the value of the
"class" attribute on the "td". Output the number of child
UIColumn
components of the UIData
component as the value of the "colspan" attribute on the "td".
Close out the "tfoot" element.
Rendering the table body
Look at the value of the "bodyrows" attribute. If present,
this must be a comma separated list of integers. Each entry in
this list is the row index of the row before which a "tbody"
element should be rendered.
If there was no "bodyrows" attribute, or it was empty, render a
"tbody" element. Keep track of the result of the "rows" property
on the UIData
component. Keep track of the number of
rows we have rendered so far. Iterate through the rows. Set the
"rowIndex" property of the UIData
component to be
correct as we iterate through the rows. Stop rendering children
and close out the "tbody" element if the "rowAvailable" property
of the UIData
returned false. If the current row
index is contained in the "bodyrows" attribute, check if a "tbody"
start element was rendered that needs to be closed, and if so,
close the "tbody" element. Then render a "tbody" element start.
Otherwise, do not render a "tbody" element.
Output a "tr" element. Output the value of the "rowClasses"
per the attribute description below, or rowClass. For each
UIColumn
child, if the column component has a
"rowHeader" attribute with a value of "true", output a "th"
element with a "scope" attribute with the value of "row".
Otherwise, if the column component has no "rowHeader" attribute,
or its value is false, output a "td" element. In either case
attach the value of the "columnClasses" attribute of the
UIData
component per the attribute description below.
Recursively encode each child of each UIColumn
child.
Close out the "td" or "th" element. When done with the row, close
out the "tr" element. When done with all the rows, close out the
"tbody" element.
When done rendering all the rows, set the "rowIndex" property of
the UIData
to -1, and close out the "table"
element.
]]>
dataTable
com.sun.faces.taglib.html_basic.DataTableTag
JSP
first
false
int
id
false
true
rendered
false
boolean
Boolean flag directing how the per-row component state should
be handled. See UIData.setRowStatePreserved for more information.
]]>
rowStatePreserved
false
boolean
rows
false
int
value
false
java.lang.Object
var
false
false
bgcolor
false
java.lang.String
bodyrows
false
java.lang.String
border
false
int
captionClass
false
java.lang.String
captionStyle
false
java.lang.String
cellpadding
false
java.lang.String
cellspacing
false
java.lang.String
columnClasses
false
java.lang.String
dir
false
java.lang.String
footerClass
false
java.lang.String
frame
false
java.lang.String
headerClass
false
java.lang.String
lang
false
java.lang.String
onclick
false
java.lang.String
ondblclick
false
java.lang.String
onkeydown
false
java.lang.String
onkeypress
false
java.lang.String
onkeyup
false
java.lang.String
onmousedown
false
java.lang.String
onmousemove
false
java.lang.String
onmouseout
false
java.lang.String
onmouseover
false
java.lang.String
onmouseup
false
java.lang.String
Per the WAI-ARIA spec and its
relationship to HTML5 (Section title ARIA Role Attriubute),
every HTML element may have a "role" attribute whose value
must be passed through unmodified on the element on which it
is declared in the final rendered markup. The attribute, if
specified, must have a value that is a string literal that is,
or an EL Expression that evaluates to, a set of
space-separated tokens representing the various WAI-ARIA roles
that the element belongs to.
It is the page author's
responsibility to ensure that the user agent is capable of
correctly interpreting the value of this attribute.
]]>
role
false
java.lang.String
Assigns one or more space-separated CSS class names to each
"tr"