I am trying to check all the checkboxes using Jsf but it is not able to checking.I have written code like this....If i select a checkbox in the header section all the checkboxes need to be selected.
<h:selectBooleanCheckbox id="c1" value="#{user.check}"></h:selectBooleanCheckbox>
<h:outputText value="name">name</h:outputText>
<h:outputText value="age">Age</h:outputText>
<h:selectBooleanCheckbox id="c2"></h:selectBooleanCheckbox>
<h:outputText value="A">A</h:outputText>
<h:outputText value="12">12</h:outputText>
<h:selectBooleanCheckbox id="c3"></h:selectBooleanCheckbox>
<h:outputText value="B">B</h:outputText>
<h:outputText value="14">14</h:outputText>
<h:selectBooleanCheckbox id="c4"></h:selectBooleanCheckbox>
<h:outputText value="C">C</h:outputText>
<h:outputText value="16">16</h:outputText>
<h:selectBooleanCheckbox id="c5"></h:selectBooleanCheckbox>
<h:outputText value="D">D</h:outputText>
<h:outputText value="18">18</h:outputText>
and my mangedbean is like this
@ManagedBean(name="user") public class Userbean {
public boolean check;
public boolean isCheck() {
return true;
}
public void setCheck(boolean check) {
this.check = check;
}
}
I dont know how to write logic for that I am trying this...can help