<o:validateMultiple id="myId" components="foo bar baz" validator="#{bean.validateValues}" /> <h:message for="myId" /> <h:inputText id="foo" /> <h:inputText id="bar" /> <h:inputText id="baz" />
public boolean validateValues(FacesContext context, List<UIInput> components, List<Object> values) { // ... }
Or by a managed bean instance which implements the MultiFieldValidator
interface:
<o:validateMultiple id="myId" components="foo bar baz" validator="#{validateValuesBean}" /> <h:message for="myId" /> <h:inputText id="foo" /> <h:inputText id="bar" /> <h:inputText id="baz" />
@ManagedBean @RequestScoped public class ValidateValuesBean implements MultiFieldValidator { @Override boolean validateValues(FacesContext context, List<UIInput> components, List<Object> values) { // ... } }
Info | Value |
---|---|
Component Type | org.omnifaces.component.validator.ValidateMultiple |
Handler Class | org.omnifaces.component.validator.ValidateMultipleHandler |
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 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. |
validator | true | javax.el.ValueExpression
(must evaluate to java.lang.Object )
|
This attribute can take either a ValueExpression representing an implementation of the
MultiFieldValidator instance, or a MethodExpression representing a validator
method with the following signature:
boolean validate(FacesContext context, List<UIInput> components, List<Object> values)
that will be called during Process Validations phase to perform correctness checks on the value of
this component.
|
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 values are "@all" which will show the message for all of the referenced components and "@invalid" which will show the message for only the invalidated components. Any other space separated value will be treated as client ID of UI input component. |
disabled | false | javax.el.ValueExpression
(must evaluate to boolean )
|
Whether the validation should be disabled or not. Defaults to false .
|
Output generated by Vdldoc View Declaration Language Documentation Generator.