I need to implement a select-all check box in jsf. here is the jsf code for check boxes. Since I'm new to JSF, can u please help me..
<rich:column id="selectCheckbox" label="#{msg.wkfSelection}" rendered="#{(circuitWorkflowDataModel.workflowStateSelected eq circuitWorkflowDataModel.initialState) or (circuitWorkflowDataModel.uncorelated)}">
<f:facet name="header">
<h:outputText value="#{msg.wkfSelection}" />
</f:facet>
<h:selectBooleanCheckbox id="gridChkBox"
value="#{gridRow.rowSelected}" valueChangeListener="#{circuitWorkflowDataModel.isBtnDisabled}" immediate="true">
<a4j:support event="onclick" reRender="updatepopup"/>
</h:selectBooleanCheckbox>
</rich:column>
and here is the managed bean. Due to some reasons i cant use javascript or jQuery. Thanks in advance
public void isBtnDisabled(ValueChangeEvent vce) throws Exception {
if(Boolean.valueOf(vce.getNewValue().toString())){
dataRowCount++;
}else{dataRowCount--;}
if(dataRowCount > 0)
this.setUpdateButtonActive(true);
else
this.setUpdateButtonActive(false);
}
public boolean isUpdateButtonActive() {
return !updateButtonActive;
}
public void setUpdateButtonActive(boolean updateButtonActive) {
this.updateButtonActive = updateButtonActive;
}