1 Reply Latest reply on Nov 5, 2008 1:19 AM by John Ament

    Still not getting it - Checkbox Binding

    John Ament Master

      Ok, so I thought I had it, then I had an epic failure.


      On my form, I have a field defined like this:


      <h:selectManyCheckbox id="item" value="#{userManager.values}">
              <s:selectItems value="#{userManager.available}" var="item" label="#{item.name}" />
              <s:convertEntity/>
      </h:selectManyCheckbox>

      And it appropriately generates all of the checkboxes I expect.  For debugging purposes, I added the following equals implementation to my class.


              @Override
              public boolean equals(Object obj) {
                      // TODO Auto-generated method stub
                      System.out.println("This... "+this.toString());
                      System.out.println("Equals.... "+obj.toString());
                      System.out.println("Type .. "+obj.getClass().getCanonicalName());
                      boolean val =  super.equals(obj);  //returns getId().equals(object.getId())
                      System.out.println("The value "+val);
                      return val;
              }

      It also returns as expected, when the id's match we return true.


      However, when I try to save the form I get a 'value is not valid'.  The 'values' and 'available' properties on usermanager return List's