我需要在jsf中实现一个select-all复选框。这是复选框的jsf代码。由于我是JSF的新手,请你帮帮我..
<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>
这是托管bean。由于某些原因,我不能使用javascript或jQuery。 提前致谢
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;
}