Here is my code: when i am trying to click my selectbox all its child selectboxes needs to selectable and when i uncheck the select box all its child selectboxes needs to Unselectable.i tried in following way..but didnt get exact output.can any one help?
<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);
}