Search code examples
javajsficefaces

selectBooleanCheckbox in icefaces


<ice:column style="width: 30px;">
                    <f:facet name="header">
                        <ice:selectBooleanCheckbox
                            value="#{createToolsOrderInwardsBean.test}" 
                            partialSubmit="true"
                            valueChangeListener="#{createToolsOrderInwardsBean.selectInwardQuantityChk}"
                            id="slc-tlmanage-selectallee"></ice:selectBooleanCheckbox>
                    </f:facet>
                    <ice:selectBooleanCheckbox value="#{currentRow.chkInwardQuantity}"
                        immediate="true" partialSubmit="true" style="margin-left: 10px;"
                        id="slc-tlmanage-enableinput"></ice:selectBooleanCheckbox>
                </ice:column>

I have this code whtin ocefaces datatable.When i select first one than all other checkbox whin that column of datatable will be selected.

below i described a valuchage method

 public void selectInwardQuantityChk(ValueChangeEvent evt){
        if(evt != null){
            Boolean value =(Boolean)evt.getNewValue();
            if(test)
                for(int i=0;i<this.toolsOrderVO.getToolsOrderItemVOList().size();i++){
                    this.toolsOrderVO.getToolsOrderItemVOList().get(i).setChkInwardQuantity(value);
                    System.out.println("int the for loop for changing value ============>"+this.toolsOrderVO.getToolsOrderItemVOList().get(i).getChkInwardQuantity());
                }

        }
    }

method called and even checkbox value can't change.


Solution

  • There were considerable typos in your question, So my understanding of your problem could be patchy. If I understand your problem correctly, then it can be solved easily.

    Add this line to your event handler.(At the start of the method)

    if (!evt.getPhaseId().equals(PhaseId.INVOKE_APPLICATION)) {
                evt.setPhaseId(PhaseId.INVOKE_APPLICATION);
                evt.queue();
                return;
            }