0 Replies Latest reply on Sep 10, 2009 8:19 AM by Jesper Vrelits

    Checkbox and table

    Jesper Vrelits Newbie

      Hi!

      I have a table with a h:selectOneCheckbox in it.

      I map it to a Map<String,Boolean> using

      <h:selectBooleanCheckbox style="border: none;width: 2em" value="#{lbopl_betalingsaftalecontroller.form.selectedLaan[laan.laaneNr]}" rendered="#{lbopl_betalingsaftalecontroller.form.generelAftale}" required="true"/>
      


      That works fine.

      Now my problem is I want to do cross field validation. I want to ensure at least one checkbox is selected. I found out to how to place a hidden field with a validator that gets called.
      The specific problem is how do I test if at least one checkbox is selected in this validator. I have succeded in retrieveing submitted value using

      UIViewRoot uiViewRoot = context.getViewRoot();
       UIInput cmp= (UIInput) uiViewRoot.findComponent("opretBetalingsaftaleFormId:betalingsAftaleTypeId");


      But how to retrieve result of multiple boolean checkboxes? What do they bind too. findComponent only returns a single UIComponent?

      Any advice appreciated.