Page 1 of 1

Primefaces datatable cell editing doesn't update

Posted: 12 Jan 2017, 20:09
by AK74M
In edit mode, I change a value and I click the save button on the page it doesn't keep the new value, If I click anywhere else first on the page then click save it will keep the value. I need it to keep the value if you click save first.

How to work around this issue? I'm using Primefaces 5.2
Thank you

Re: Primefaces datatable cell editing doesn't update

Posted: 13 Jan 2017, 11:45
by jgaslain
Hello,

I just wrote a page with celledit edition mode, maybe I can help.
Can you post your code ?

Re: Primefaces datatable cell editing doesn't update

Posted: 13 Jan 2017, 21:21
by AK74M
The code is very simple

<p:dataTable id="countsTableID" var="row" rows="10" editable="true" editMode="cell" value="#{establishmentBean.meatMetricRedDtoList}" >
<f:facet name="header">
<h:outputLabel value="Approved" /> <br/>
</f:facet>

<p:column style="white-space: nowrap;text-align:right">
<p:cellEditor >
<f:facet name="output"><h:outputText id="approvedWeightID" value="#{row.approvedWeight}" style=" width:100%;"/></f:facet>
<f:facet name="input">
<p:inputText id="approvedWeightEditID" value="#{row.approvedWeight}" >

</p:inputText>
</f:facet>
</p:cellEditor>
</p:column>



</p:dataTable>



<p:commandButton id="saveButtonID" value="#{msg['button.save']}"
action="#{establishmentBean.actionSaveCounts('RED')}"
process="@form"
update="@form" />

If to enter cell into edit mode and edit value and then click Save. The button action is performed but no edited value set in backing bean.

If to add ajax on change event to the p:input element
<p:ajax event="change" process="@this" update="@this"/>
and Then if to click Save the edited value updated in the backing bean but no action method executed.

Thank you.

Re: Primefaces datatable cell editing doesn't update

Posted: 16 Feb 2017, 12:11
by hbenabed
I have the same problem :(
did you find a solution??

Re: Primefaces datatable cell editing doesn't update

Posted: 20 Feb 2017, 15:27
by chrishj
It makes it easier to see if you use "Code" blocks for your code.

Have you tried the ajax event "cellEdit"?
(See the showcase for an example and documentation)

Re: Primefaces datatable cell editing doesn't update

Posted: 02 Oct 2019, 12:31
by albatros
I have the same problem. I'm using Primefaces 7.0. with the theme Harmony.
Does any body solved this issue ?

It's urgent. Thanks

Re: Primefaces datatable cell editing doesn't update

Posted: 02 Oct 2019, 15:48
by albatros