这是我的代码:当我尝试单击我的选择框时,它的所有子选择框都需要选择,当我取消选中选择框时,它的所有子选择框都需要取消选择。我尝试了以下方式..但没有得到确切的输出。可以一个帮助?
<ace:dataTable>
<ace:column>
<f:facet name="header" >
<ice:selectBooleanCheckbox partialSubmit="true" value="#{maintainDocumentController.selectAll}"
valueChangeListener="#{maintainDocumentController.toggleSelectAll}"/>
</f:facet>
<div align="center">
<ice:selectBooleanCheckbox value="#{row.selected}"
partialSubmit="true"
valueChangeListener="#{maintainDocumentController.uncheckAllSelected}" /></div>
</ace:column>
</ace:dataTable>
public void toggleSelectAll(ValueChangeEvent valueChangeEvent) {
//this.selectAll=true;
if (valueChangeEvent != null) {
if (!valueChangeEvent.getPhaseId().equals(
PhaseId.INVOKE_APPLICATION)) {
valueChangeEvent.setPhaseId(PhaseId.INVOKE_APPLICATION);
valueChangeEvent.queue();
return;
}// End if
}
pickList=this.searchCriteriaVo.getResultList();
if (pickList != null)
{
int size=pickList.size();
for (int rowNum = 0; rowNum < size; rowNum++) {
SearchCriteriaVo searchCriteriaVO = (SearchCriteriaVo) pickList.get(rowNum);
searchCriteriaVO.setSelected(((Boolean) valueChangeEvent
.getNewValue()).booleanValue());
}}
}
public void uncheckAllSelected( ValueChangeEvent valueChangeEvent )
{
//this.selectAll=false;
if ( !valueChangeEvent.getPhaseId( ).equals( PhaseId.INVOKE_APPLICATION ) )
{
valueChangeEvent.setPhaseId( PhaseId.INVOKE_APPLICATION );
valueChangeEvent.queue( );
return;
}// End If
SearchCriteriaVo tempSearchCriteriaVo=(SearchCriteriaVo)searchCriteriaVo.getDocMaintainTable().getRowData();
Boolean newValue = ( ( Boolean ) valueChangeEvent.getNewValue( ) ).booleanValue( );
tempSearchCriteriaVo.setSelected(newValue);
}