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
message
attribute. Any "{0}" placeholder in the message will be substituted with the label of the
input component. Any "{1}" placeholder in the message will be substituted with the 1-based row index of the data
model. Note that this does not take pagination into account and that this needs if necessary to be taken care of in
the custom message yourself.
<o:validateUniqueColumn message="Duplicate value!" />
Name | Required | Type | Description |
---|---|---|---|
disabled | false | jakarta.el.ValueExpression
(must evaluate to boolean )
|
Whether the validation should be disabled or not. Defaults to false .
|
message | false | jakarta.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 the label of the input component. Any "{1}" placeholder in the message will be substituted with the 1-based row index of the data model. |
Output generated by Vdldoc View Declaration Language Documentation Generator.