vendredi 15 janvier 2016

JSF : How to set checkboxes of a selectManyCheckbox to checked if a condition is true

I want to set checkboxes of a selectManyCheckbox to checked if a condition is true "#{myBean.isCondition}":

MyBean.java

public class MyBean{
  private boolean isCondition;
  ...

  public boolean isCondition{
      return isCondition;
  }
  ...
}

my_page.jspx :

<h:selectManyCheckbox 
    layout="pageDirection"
    label="#{messages['numsTelephone.label']}"
    value="#{listSelected}">
    <s:selectItems var="clientTelephone" 
                value="#{list}"
                label="#{clientTelephone}" />
</h:selectManyCheckbox>

I need to know if it exist something like

checked = "#{myBean.isCondition}"

that I can add in my selectManyCheckbox bloc ? Or should I use a javascript ?

Any other solution is welcome too.

Thanks,




Aucun commentaire:

Enregistrer un commentaire