0 Replies Latest reply on Feb 24, 2012 6:03 AM by aymen aymen

    h:selectBooleanCheckbox  always return false

    aymen aymen Newbie

      hello,

      i have a strange problem.i have an h:selectBooleanCheckbox  that's working well and then it suddenly return always false.nor the XHTML or the managed been was changed but it start to return always false.

      this is the code for the JSF tag:

       

      <h:selectBooleanCheckbox  value="#{item.selected}"  disabled="#{item.disabled}"   >

                                  <a4j:ajax  event="click"   listener="#{vehiculeFilterBean.checkCases}" render="resultatTableVehicule visualizer" >

                                  </a4j:ajax>

                                  <f:param name="caseacocher" value="#{item.idAsset}" />

                                  </h:selectBooleanCheckbox>

       

      for the been:

       

      private boolean selected;//pour determiner si cet asset a ete selection pour afficher son trajet ou non

       

      public boolean isSelected() {

                  return selected;

              }

       

       

       

       

              public void setSelected(boolean selected) {

                  this.selected = selected;

              }

       

      for the managed been

       

      String values = FacesContext.getCurrentInstance().getExternalContext()

                      .getRequestParameterMap().get("caseacocher");

       

              Iterator it = records.iterator();

              nombreAssSelected = 0;

              System.out.println("le nombre d'element est  " + records.size());

              while (it.hasNext()) {

                  Asset ass = (Asset) it.next();

                  System.out.println("id  " + ass.getIdasset());

                  System.out.println("is selected? " + ass.isSelected());

       

                  if (ass.isSelected() == true) {

                      System.out.println("id asset vaut " + values);

                      nombreAssSelected++;

                      Device device = ass.getDevice();

                      if (device != null) {

       

                          idassetselected.add(new Integer(device.getIddevice()));

                      }

       

                  }

              }

       

       

      System.out.println("is selected? " + ass.isSelected());

      return always false

      this manged been is session scooped

       

      @ManagedBean

      @SessionScoped

       

      any help will be appreciated

      thginks