0
votes

Presently I am conditionaly rendering the Checkbox inside outputPanel,but when i am selecting it,its value is not getting updated in the backing bean.Please help how can I fix this.

Please find the code below:

<p:outputPanel rendered="#{dataBean.dataCleanModel.checkThresholdValueForStdDev(o)}">
<td><h:selectBooleanCheckbox value="#{o.checkBoxToAcceptTheRow}"/></td>
</p:outputPanel>

<p:outputPanel  rendered="#{!dataBean.dataCleanModel.checkThresholdValueForStdDev(o)}">
<td><h:selectBooleanCheckbox value="#{o.checkBoxToAcceptTheRow}" /></td>
</p:outputPanel>

As shown changing the checkbox value corresponding setter method is not getting invoked/changed value is not getting set in the bean

1

1 Answers

0
votes

use <f:ajax/> if you want the check box to immediately set the value to the server

<h:form>
<p:outputPanel rendered="#{dataBean.dataCleanModel.checkThresholdValueForStdDev(o)}">
<td>
    <h:selectBooleanCheckbox value="#{o.checkBoxToAcceptTheRow}">
        <f:ajax/>
    </h:selectBooleanCheckbox>
</td>
</p:outputPanel>

<p:outputPanel  rendered="#{!dataBean.dataCleanModel.checkThresholdValueForStdDev(o)}">
<td>
    <h:selectBooleanCheckbox value="#{o.checkBoxToAcceptTheRow}">
        <f:ajax/>
    </h:selectBooleanCheckbox>
</td>
</p:outputPanel>
</h:form>