<anyxmlelement xmlns:o="http://omnifaces.org/ui"/>
Info | Value |
---|---|
ID (tag prefix) | o |
URI | http://omnifaces.org/ui |
Tag | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
tree |
o:tree is an UIComponent that supports data binding to a tree
of data objects represented by a TreeModel instance, which is the current value of this
component itself (typically established via a ValueExpression . During iterative processing
over the nodes of tree in the tree model, the object for the current node is exposed as a request
attribute under the key specified by the var attribute. The node itself is exposed as a
request attribute under the key specified by the varNode attribute.
Only children of type This component does not have a renderer since it does not render any markup by itself. This allows the developers to have full control over the markup of the tree by declaring the appropriate JSF components or HTML elements in the markup. Here is a basic usage example: <o:tree value="#{bean.treeModel}" var="item" varNode="node"> <o:treeNode> <ul> <o:treeNodeItem> <li> #{node.index} #{item.someProperty} <o:treeInsertChildren /> </li> </o:treeNodeItem> </ul> </o:treeNode> </o:tree> |
||||||||||
treeNode |
o:treeNode is an UIComponent that represents a single tree node
within a parent Tree component. Within this component, the var attribute of
the parent Tree component will expose the tree node. Each of its children is processed by
TreeNodeItem .
The |
||||||||||
treeNodeItem |
o:treeNodeItem is an UIComponent that represents a single child
tree node within a parent TreeNode component. Within this component, the var
attribute of the parent Tree component will expose the child tree node.
This component allows a child component of type |
||||||||||
treeInsertChildren |
o:treeInsertChildren is an UIComponent that represents the
insertion point for the children of a parent tree node which is represented by
TreeNodeItem .
This component does not allow any children. |
||||||||||
resourceInclude | This component includes the output from a resource located at the given path. This path can not extend outside of the current Servlet context. A resource is either a Servlet or a JSP page. | ||||||||||
onloadScript |
o:onloadScript is an extension to <h:outputScript> which will be executed in the
end of the HTML body (thus when all HTML elements are initialized in the HTML DOM tree) and will re-execute its
script body on every ajax request. This is particularly useful if you want to re-execute a specific helper script
to manipulate the HTML DOM tree, such as (re-)adding fancy tooltips, performing highlights, etcetera, also after
changes in the HTML DOM tree on ajax responses.
You can put it anywhere in the view, it will always be relocated to the end of body. <o:onloadScript>alert('OnloadScript is invoked!');</o:onloadScript> |
||||||||||
highlight |
o:highlight is a helper component which highlights all invalid {@link UIInput} components and the
associated labels by adding an error style class to them. Additionally, it by default focuses the first invalid
{@link UIInput} component. The <o:highlight /> component can be placed anywhere in the view, as
long as there's only one of it. Preferably put it somewhere in the master template for forms.
<h:form> <h:inputText value="#{bean.input1}" required="true" /> <h:inputText value="#{bean.input1}" required="true" /> <h:commandButton value="Submit" action="#{bean.submit}" /> </h:form> <o:highlight />
The default error style class name is label.error { color: #f00; } input.error, select.error, textarea.error { background-color: #fee; }
You can override the default error style class by the <o:highlight styleClass="invalid" />
You can disable the default focus on the first invalid input element setting the <o:highlight styleClass="invalid" focus="false" /> |
||||||||||
conditionalComment |
o:conditionalComment is an <!--[if lte IE 7]> <link rel="stylesheet" href="ie6-ie7.css" /> <![endif]--> However, Facelets renders them HTML-escaped and if <h:outputText value="<!--[if lte IE 7]><link rel="stylesheet" href="ie6-ie7.css" /><![endif]-->" escape="false" /> This component is designed to solve this problem. <o:conditionalComment if="lte IE 7"> <link rel="stylesheet" href="ie6-ie7.css" /> </o:conditionalComment> Note that you cannot use this with |
||||||||||
validateAll |
o:validateAll validates validates if ALL of the given UIInput
components have been filled out. The default message is
{0}: Please fill out all of those fields General usage of all multiple field validators
This validator must be placed inside the same <o:validateMultipleFields id="myId" components="foo bar baz" /> <h:message for="myId" /> <h:inputText id="foo" /> <h:inputText id="bar" /> <h:inputText id="baz" />
In an invalidating case, all of the referenced components will be marked invalid and a faces message
will be added on the client ID of this validator component. The default message can be changed by the
<o:validateMultipleFields components="foo bar baz" message="{0} are wrong!" />
The faces message can also be shown for all of the referenced components using
<o:validateMultipleFields components="foo bar baz" message="This is wrong!" showMessageFor="@all" /> <h:inputText id="foo" /> <h:message for="foo" /> <h:inputText id="bar" /> <h:message for="bar" /> <h:inputText id="baz" /> <h:message for="baz" />
The
The validator can be disabled by the <o:validateMultipleFields components="foo bar baz" disabled="#{param.validationDisabled}" />
There is a read-only <o:validateMultipleFields id="myId" binding="#{myId}" components="foo bar baz" /> <h:panelGroup rendered="#{myId.validationFailed}"> Validation has failed! <h:message for="myId" /> </h:panelGroup> |
||||||||||
validateAllOrNone |
o:validateAllOrNone validates validates if at least ALL of the given UIInput
components have been filled out or that NONE of the given UIInput components have been
filled out. The default message is
{0}: Please fill out all or none of those fields
For general usage instructions, refer |
||||||||||
validateOneOrMore |
o:validateOneOrMore validates if at least ONE of the given UIInput
components has been filled out. The default message is
{0}: Please fill out at least one of those fields
For general usage instructions, refer |
||||||||||
validateOne |
o:validateOne validates if ONLY ONE of the given UIInput
components has been filled out. The default message is
{0}: Please fill out only one of those fields
For general usage instructions, refer |
||||||||||
validateOneOrNone |
o:validateOneOrNone validates if ONLY ONE of the given UIInput components has been filled
out or that NONE of the given UIInput components have been filled out. The default message is
{0}: Please fill out only one or none of those fields
For general usage instructions, refer |
||||||||||
validateEqual |
o:validateEqual validates if ALL of the given UIInput components have the
same value. The default message is
{0}: Please fill out the same value for all of those fields
For general usage instructions, refer |
||||||||||
validateUnique |
o:validateUnique validates if ALL of the given UIInput components have an
unique value. The default message is
{0}: Please fill out an unique value for all of those fields
For general usage instructions, refer |
||||||||||
validateOrder |
ValidateOrder validates if the values of the given UIInput components as specified in
the components attribute are in the order as specified by the type attribute which accepts
the following values:
{0}: Please fill out the values of all those fields in order
For general usage instructions, refer
This validator has the additional requirement that the to-be-validated values must implement |
||||||||||
validator |
The <o:validator> basically extends the <f:validator> tag family with the
possibility to evaluate the value expression in all attributes on a per request basis instead of on a per view
build time basis. This allows the developer to change the attributes on a per request basis, such as the
disabled attribute.
<o:validator validatorId="someValidatorId" disabled="#{param.disableValidation}" /> Note that not all available attributes are listed. This depends on the validator you're specifying.
When you specify for example the standard <o:validator validatorId="javax.faces.LongRange" minimum="#{item.minimum}" maximum="#{item.maximum}" /> |
||||||||||
converter |
The <o:converter> basically extends the <f:converter> tag family with the
possibility to evaluate the value expression in all attributes on a per request basis instead of on a per view
build time basis. This allows the developer to change the attributes on a per request basis.
When you specify for example the standard <o:converter converterId="javax.faces.DateTime" pattern="#{item.pattern}" locale="#{item.locale}" /> |
||||||||||
viewParam |
o:viewParam is a component that extends the standard viewParam and provides a stateless
mode of operation and a default for the label atrribute. When the label attribute is omitted, the name
attribute will be used instead.
The standard UIViewParameter implementation calls the model setter again after postback. This is not always desired when being bound to a view scoped beans and can lead to performance problems when combined with an expensive converter. To solve this, this component by default stores the submitted value as a component property instead of in the model (and thus in the view state in case the binding is to a view scoped bean).
You can use it the same way as |
||||||||||
methodParam |
o:methodParam is a tag handler that can be used to pass a method expression
into a Facelets tag.
By default this is not possible, and the expression that's intended to be a method expression will be created and made available as a value expression. This handler should be placed inside a Facelets tag as follows: <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:o="http://omnifaces.org/ui" > <o:methodParam name="method" value="#{action}"/> <h:commandButton value="test" action="#{method}" /> </ui:composition>
Assuming the above is a tag called <test:actionmethod action="#{methodParamBean.doAction}" />
In case a method with no parameters is passed that is to be used as an action listener with no parameters, then the component
using this method unfortunely has to be wrapped by a component that puts the method in request scoped (with nested visibility),
e.g. by using <ui:repeat var="method" value="#{method}"> <h:commandButton value="test" actionListener="#{method}" /> </ui:repeat>
Using modern EL implementations, this is not needed in case the EL expression references the method using explicit parenthesis,
e.g. |
||||||||||
componentIdParam |
ComponentIdParam is a component that allows component ids to be provided as request parameters
causing only components with matching ids to be rendered.
Both simple component ids as well as client ids are supported. Components can be rendered without their parents having to be rendered. As such, e.g. single rows appearing in a table can be rendered without any of the surrounding markup appearing in the response. The intended usage of this component is to allow client-side scripts to request markup for specific components via a GET request (as opposed to AJAX based post-backs). This component is used in the same way view parameters are and needs to be put into the metadata section of a Facelet. |
||||||||||
outputFormat |
OutputFormat is a component that extends the standard HtmlOutputFormat and provides support
for capturing the output and exposing it into the request scope by the variable name as specified by the
var attribute.
|
||||||||||
outputLabel |
o:outputLabel is a component that extends the standard outputLabel and provides extra support for
automatically setting its value as the label of the component identified by its for attribute.
It renders an HTML "label" element. If a "for" attribute is specified, the component specified by the value of the "for" attribute is queried for its client id, which is then rendered as the value of the "for" attribute of the HTML label element. |
||||||||||
form |
Form is a component that extends the standard UIForm and provides a way to keep view
parameters in the request URL after a post-back and offers in combination with the
<o:ignoreValidationFailed> tag on an UICommand component the possibility to ignore
validation failures so that the invoke action phase will be executed anyway.
|
||||||||||
cache |
Cache is a component that initially renders the output of its children into a buffer
instead of to the response. This output is then inserted into a cache and on subsequent requests the
content retrieved from the cache is used.
By default the viewid concatenated to the component id via an underscore is used as the cache key. Note that this component does not support a cache loader and locking mechanism. This mean several simultaenous page requests may render the same content and it's undetermined which of those will end up being cached. An optional caching provider (see below) can be set to control the caching implementation that is used for the actual caching. If no such provider is installed, a default caching implementation is used that's based on http://code.google.com/p/concurrentlinkedhashmap in case a maximum cache capacity is set, or on a plain ConcurrentMap if no capacity is set.
Setting a custom caching providerA custom caching provider can be set by using theorg.omnifaces.CACHE_PROVIDER context
parameter in web.xml to point to an implementation of org.omnifaces.component.output.cache.CacheProvider .
For example:
<context-param> <param-name>org.omnifaces.CACHE_PROVIDER</param-name> <param-value>com.example.MyProvider</param-value> </context-param>
The default provider, Global settingsFor the default provider, the maximum capacity and the default time to live can be specified for the supported scopes "session" and "application". If the maximum capacity is reached, an entry will be evicted following a least recently used policy. The default time to live specifies for how long entries are considered to be valid. A value for thetime attribute on this component
will override this global default time to live. The following context parameters can be used in web.xml:
Servlet 2.5 configurationIf no custom caching provider or global settings are used, no specific configuration is needed. Otherwiseorg.omnifaces.component.output.cache.CacheInitializerListener needs to be installed as a
listener in web.xml:
<listener> <listener-class>org.omnifaces.component.output.cache.CacheInitializerListener</listener-class> </listener>In case the alternative caching method via buffering is used, org.omnifaces.servlet.BufferedHttpServletResponse needs
to be installed as a Servlet Filter in web.xml, filtering either the FacesServlet itself or any page on which the alternative caching
method is required.
|
||||||||||
cacheValue |
Tag handler (runs at tree build-time) that makes a value expression available under the given name that caches its value.
Although the value expressions scope is that of the entire Facelet in which this tag appears, the value it self is cached
using the parent Cache component.
This means that if the parent
The direct parent of this component MUST be
The intended use of this is to explicitly cache a value expression that is used by one of the component children of |
||||||||||
importConstants |
The public class Foo { public static final String FOO1 = "foo1"; public static final String FOO2 = "foo2"; } public interface Bar { public static final String BAR1 = "bar1"; public static final String BAR2 = "bar2"; } public enum Baz { BAZ1, BAZ2; } The constant field values of the above types can be mapped into the EL scope as follows: <o:importConstants type="com.example.Foo" /> <o:importConstants type="com.example.Bar" /> <o:importConstants type="com.example.Baz" var="Bazzz" /> ... #{Foo.FOO1}, #{Foo.FOO2}, #{Bar.BAR1}, #{Bar.BAR2}, #{Bazzz.BAZ1}, #{Bazzz.BAZ2} The map is by default stored in the EL scope by the simple name of the type as variable name. You can override
this by explicitly specifying the The resolved constants are by reference stored in the cache to improve retrieving performance. |
||||||||||
importFunctions |
The <o:importFunctions type="java.lang.Math" var="m" /> <o:importFunctions type="org.omnifaces.util.Faces" /> ... #{m:abs(-10)} #{m:max(bean.number1, bean.number2)} ... <base href="#{Faces:getRequestBaseURL()}" /> The functions prefix becomes by default the simple name of the type. You can override this by explicitly
specifying the Note that the colon The resolved functions are by reference stored in the cache to improve retrieving performance. |
||||||||||
ignoreValidationFailed |
The <o:ignoreValidationFailed> allows the developer to ignore validation failures when
executing an UICommand action. This taghandler must be placed inside an UICommand component and the
parent UIForm must be an <o:form> .
Any validation errors will be ignored and thus not be displayed. Note that the model values will (obviously) only be updated for components which have passed the validation. |
||||||||||
enableRestorableView |
The <o:enableRestorableView> instructs the view handler to recreate the entire view whenever the
view has been expired, i.e. whenever #restoreView(FacesContext, String) returns null and the
current request is a postback. This effectively prevents ViewExpiredException on the view. This tag needs to
be placed in <f:metadata> of the view.
There are however technical design limitations: please consult the javadoc for details. To the point, the bean associated with the view has to be exclusively request scoped in order to properly recreate the same view. |
||||||||||
validateBean |
The <o:validateBean> allows the developer to control bean validation groups on a
per-UICommand or UIInput component basis. Usage example:
<h:commandButton> <o:validateBean groups="javax.validation.groups.Default,com.example.MyGroup"/> </h:commandButton> |
||||||||||
validateUniqueColumn |
ValidateUniqueColumn validates if the given UIInput component in an UIData component
has an unique value throughout all rows, also those not visible by pagination. This validator works directly on the
data model and may therefore not work as expected if the data model does not represent all available
rows of the UIData component (e.g. when there's means of lazy loading).
The default message is {0}: Please fill out an unique value for the entire column. Duplicate found in row {1} Usage example: <h:dataTable value="#{bean.items}" var="item"> <h:column> <h:inputText value="#{item.value}"> <o:validateUniqueColumn /> </h:inputText> </h:column> </h:dataTable>
In an invalidating case, only the first row on which the value is actually changed (i.e. the value change event has
been fired on the input component in the particular row) will be marked invalid and a faces message will be added
on the client ID of the input component in the particular row. The default message can be changed by the
<o:validateUniqueColumn message="Duplicate value!" /> |
||||||||||
commandScript |
CommandScript is an extension to
The
Basic usage example of <h:form> <h:inputText value="#{bean.input1}" ... /> <h:inputText value="#{bean.input2}" ... /> <h:inputText value="#{bean.input3}" ... /> <o:commandScript name="submitForm" action="#{bean.submit}" render="@form" /> </h:form> <input type="button" value="submit" onclick="submitForm()" />
Usage example which uses the <h:form> <h:dataTable id="data" value="#{bean.data}" ...>...</h:dataTable> <o:commandScript name="updateData" action="#{bean.reloadData}" render="data" /> </h:form> <h:outputScript target="body">setInterval(updateData, 3000);</h:outputScript>The component also supports nesting of <f:param> , <f:actionListener> and
<f:setPropertyActionListener> , exactly like as in <h:commandXxx> . The function
also supports a JS object as argument which will then end up in the HTTP request parameter map:
functionName({ name1: "value1", name2: "value2" }); With the above example, the parameters are in the action method available as follows: String name1 = Faces.getRequestParameter("name1"); // value1 String name2 = Faces.getRequestParameter("name2"); // value2 |
||||||||||
param |
Param is a component that extends the standard UIParameter to implement ValueHolder
and thus support a Converter to convert the supplied value to string, if necessary.
You can use it the same way as |
Output generated by Vdldoc View Declaration Language Documentation Generator.