2 Replies Latest reply on Jul 12, 2011 4:51 PM by Richard Clarke

    Cross-field Validation within data table

    Richard Clarke Newbie

      Hi,
      First time post, so go easy on me.
      I am using Seam 3 faces module with Richfaces 4, JSF2, Seam 3 under JBoss AS 6. 


      I have a form which displays a richfaces rich:dataTable component (although I guess my question would relate to any ui:repeat component). The table lists a selectOneListBox and an inputText field in each row.


      I would like to use Seam's s:validateForm tag and us a custom Validator to check each row to ensure the text field is a valid entry for the selection in the selectOneListBox. For example if the selectOneListBox has 'Passport' selected, then the user should enter a passport number in the text field, and if the user select 'Driving License' then the user should enter the driving license number etc.


      I have other validation on the form working fine using a custom validator implementing javax.faces.validator.Validator, and injected InputElements.


      I am wondering how to perform validation across these 2 fields.
      Any suggestions most welcome.
      Rich