Primefaces datatable cell editing doesn't update

UI Components for JSF
Post Reply
AK74M
Posts: 2
Joined: 12 Jan 2017, 20:06

12 Jan 2017, 20:09

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

jgaslain
Posts: 5
Joined: 16 Dec 2016, 19:17

13 Jan 2017, 11:45

Hello,

I just wrote a page with celledit edition mode, maybe I can help.
Can you post your code ?
Primefaces 6.0
JSF 2.1
Tomcat 7.0
Java 8

AK74M
Posts: 2
Joined: 12 Jan 2017, 20:06

13 Jan 2017, 21:21

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.

hbenabed
Posts: 3
Joined: 24 Mar 2015, 17:30

16 Feb 2017, 12:11

I have the same problem :(
did you find a solution??

chrishj
Posts: 229
Joined: 11 Jul 2011, 21:58
Location: England, Lancashire
Contact:

20 Feb 2017, 15:27

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)
PrimeReact: 9.6.0
NextJs: 13.4.12
Theme Apollo v9.0
Database pg 8.8.0
react-hook-form: 7.38.0

albatros
Posts: 27
Joined: 01 Apr 2011, 23:17

02 Oct 2019, 12:31

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

albatros
Posts: 27
Joined: 01 Apr 2011, 23:17

02 Oct 2019, 15:48


Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 47 guests