I have a datatable with rowEditor. It was working without problems until I set its rendered attribute.
I changed the rendered attribute to false by default. When user selects a booleancheckbox, it is set to true and rendered with ajax. But In this case, rowEditor is not working correctly. when pencil icon is clicked, row is switched to in-cell editing mode, but it is not switched to display mode even you clicked ok icon or cancel icon.
Is there a way to solve this problem?
Thanks,
Code: Select all
<h:form prependId="false">
<h:selectBooleanCheckbox id="remember" value="#{tableBean.render}">
<p:ajax update="carList" />
</h:selectBooleanCheckbox>
<p:outputPanel id="carList" >
<p:dataTable var="car" value="#{tableBean.carsSmall}" rendered="#{tableBean.render}">
<f:facet name="header">
In-Cell Editing
</f:facet>
<p:column headerText="Model" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.model}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.model}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Year" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.year}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{car.year}" style="width:100%"/>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Manufacturer" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.manufacturer}" />
</f:facet>
<f:facet name="input">
<h:selectOneMenu value="#{car.manufacturer}" >
<f:selectItems value="#{tableBean.manufacturers}"
var="man"
itemLabel="#{man}"
itemValue="#{man}" />
</h:selectOneMenu>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Color" style="width:150px">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{car.color}" />
</f:facet>
<f:facet name="input">
<h:selectOneMenu value="#{car.color}" >
<f:selectItems value="#{tableBean.colors}"
var="color"
itemLabel="#{color}"
itemValue="#{color}" />
</h:selectOneMenu>
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Options">
<p:rowEditor />
</p:column>
</p:dataTable>
</p:outputPanel>
</h:form>
Mojarra 2.0.4-b09