Hi all,
I'm quite new to this discussion list, and I found it very interesting.
I'm sorry if the problem has been already discussed.
I have a dataTable with a checkbox on each row (an extract is below).
I'd like to create a custom validator that verifies that at least a
checkbox in the list has been selected.
However, I cannot apply it directly on the h:selectBooleanCheckbox
component, since it a "relationship validator". It seems it cannot be
applied to t:dataTable, since it isn't an UIInput component (I'm not
really sure about this).
I can perform the check directly in the action and generate a
FacesMessage object, but this means that the check is after the Update
Model Values phase, where I prefer it would be in the Process
Validations phase.
Is there a correct way to approach this problem?
I'm using JSF 1.1.
Regards,
Dario
<t:dataTable value="#{lab.datas}" var="varData">
<h:column id="sel">
<h:selectBooleanCheckbox id="checked1"
value="#{varData.checked}" />
</h:column>
<h:column id="person">
<h:outputLabel
value="#{varData.person}" for="checked1"/>
</h:column>
</t:dataTable>
<h:commandButton type="submit" value="#{someAction}" />