I have a dataTable that is editable (editMode = "cell"
).
Editing free text field and list box is quite straightforward. However, I cannot figure out how to edit checkbox field. To be more specific when I try to edit checkbox selection, the data in the output facet is not actualized after the change was made.
<p:dataTable id="submodels" var="submodel" value="#{projectMB.submodels}"
editable="true" editMode="cell" widgetVar="cellSubmodels">
<p:column headerText="Mapping file">
<p:cellEditor>
<f:facet name="output">
<h:selectBooleanCheckbox value="#{submodel.mapping}" onclick="return false;"
style="width:96%" label="Root model" readonly="true"/>
</f:facet>
<f:facet name="input">
<h:selectBooleanCheckbox value="#{submodel.mapping}" style="width:96%"
label="Root model"/>
</f:facet>
</p:cellEditor>
</p:column>
</p:dataTable>
What is a bit suprising, when I change input facet into inputText (and enter true/false value in it), checkbox is updated properly:
<p:dataTable id="submodels" var="submodel" value="#{projectMB.submodels}"
editable="true" editMode="cell" widgetVar="cellSubmodels">
<p:column headerText="Mapping file">
<p:cellEditor>
<f:facet name="output">
<h:selectBooleanCheckbox value="#{submodel.mapping}" onclick="return false;"
style="width:96%" label="Root model" readonly="true"/>
</f:facet>
<f:facet name="input">
<p:inputText value="#{submodel.mapping}" style="width:96%" />
</f:facet>
</p:cellEditor>
</p:column>
</p:dataTable>
Can you point out what I have done wrong? I get no errors in javascript console and on Java server side.
I'm using Primefaces version 4.0