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
This validator must be placed inside the same UIForm
as the UIInput
components
in question. The UIInput
components must be referenced by a space separated collection of
their client IDs in the components
attribute. This validator can be placed anywhere in the
form, but keep in mind that the components will be validated in the order as they appear in the form.
So if this validator is been placed before all of the components, then it will be executed before any of
the component's own validators. If this validator fails, then the component's own validators will not be
fired. If this validator is been placed after all of the components, then it will be executed after any
of the component's own validators. If any of them fails, then this validator will not be exeucted. It
is not recommended to put this validator somewhere in between the referenced components as the resulting
behaviour may be confusing. Put this validator either before or after all of the components, depending
on how you would like to prioritize the validation.
<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
message
attribute. Any "{0}" placeholder in the message will be substituted with a comma
separated string of labels of the referenced input components.
<o:validateMultipleFields components="foo bar baz" message="{0} are wrong!" />
The faces message can also be shown for all of the referenced components using
showMessageFor="@all"
.
<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 showMessageFor
attribute defaults to @this
. Other values than
@this
or @all
are not allowed.
The validator can be disabled by the disabled
attribute. It accepts a request based EL expression.
<o:validateMultipleFields components="foo bar baz" disabled="#{param.validationDisabled}" />
There is a read-only validationFailed
attribute which can be used to determine if the validation by
this component has failed.
<o:validateMultipleFields id="myId" binding="#{myId}" components="foo bar baz" /> <h:panelGroup rendered="#{myId.validationFailed}"> Validation has failed! <h:message for="myId" /> </h:panelGroup>
Info | Value |
---|---|
Component Type | org.omnifaces.component.validator.ValidateAll |
Handler Class | None |
Renderer Type | None |
Description | None |
Name | Required | Type | Description |
---|---|---|---|
id | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The component identifier for this component. This value must be unique within the closest parent component that is a naming container. |
rendered | false | javax.el.ValueExpression
(must evaluate to java.lang.Boolean )
| Flag indicating whether or not this component should be rendered (during Render Response Phase), or processed on any subsequent form submit. The default value for this property is true. |
binding | false | javax.el.ValueExpression
(must evaluate to javax.faces.component.UIComponent )
|
The ValueExpression linking this component to a property in a backing bean.
|
components | true | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The space separated collection of client IDs of UI input components to be validated. |
message | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The validator message to be shown on failure. Any "{0}" placeholder in the message will be substituted with a comma separated string of labels of the referenced input components. |
showMessageFor | false | javax.el.ValueExpression
(must evaluate to java.lang.String )
| The identifier for which this validator should show the message. Defaults to "@this" which is the validator component itself. Other available value is "@all" which will show the message for all of the referenced components. |
disabled | false | javax.el.ValueExpression
(must evaluate to java.lang.Boolean )
|
Whether the validation should be disabled or not. Defaults to false .
|
Output generated by Vdldoc View Declaration Language Documentation Generator.