Note that there are some explanatory texts on larger screens.

plurals
  1. POCell edit in primefaces is not updating the value
    primarykey
    data
    text
    <p>I have a datatable in my primefaces application . The code for the frontend has </p> <pre><code> &lt;!-- Start of customer datatable --&gt; &lt;p:dataTable var="customer" value="#{customerBean.customers}" paginator="true" selection="#{customerBean.selectedCustomer}" selectionMode="single" onRowSelectUpdate=":custList" onRowSelectComplete="custTab.show()" id="custList" widgetVar="custList" update=":custList"&gt; &lt;f:facet name="header"&gt; List of Customers &lt;p:outputPanel&gt; &lt;p:commandButton value="+" type="button" onclick="addCustDlg.show()"/&gt; &lt;/p:outputPanel&gt; &lt;/f:facet&gt; &lt;p:column sortBy="#{customer.id}" filterBy="#{customer.id}" update=":custList"&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="ID"/&gt; &lt;/f:facet&gt; &lt;h:outputText value="#{customer.id}"/&gt; &lt;/p:column&gt; &lt;p:column sortBy="#{customer.name}" filterBy="#{customer.name}" headerText="NAME" filterMatchMode="contains" update=":custList"&gt; &lt;p:cellEditor&gt; &lt;f:facet name="output"&gt; &lt;h:outputText value="#{customer.name}"/&gt; &lt;/f:facet&gt; &lt;f:facet name="input"&gt; &lt;p:inputText value="#{customer.name}"/&gt; &lt;/f:facet&gt; &lt;/p:cellEditor&gt; &lt;/p:column&gt; &lt;p:column sortBy="#{customer.description}" filterBy="#{customer.description}" headerText="DESCRIPTION"&gt; &lt;p:cellEditor&gt; &lt;f:facet name="output"&gt; &lt;h:outputText value="#{customer.description}"/&gt; &lt;/f:facet&gt; &lt;f:facet name="input"&gt; &lt;p:inputText value="#{customer.description}"/&gt; &lt;/f:facet&gt; &lt;/p:cellEditor&gt; &lt;/p:column&gt; &lt;p:column sortBy="#{customer.signupDate}" filterBy="#{customer.signupDate}" headerText="SIGN UP DATE"&gt; &lt;f:facet name="output"&gt; &lt;h:outputText value="#{customer.signupDate}"/&gt; &lt;/f:facet&gt; &lt;/p:column&gt; &lt;p:column sortBy="#{customer.validUntil}" filterBy="#{customer.validUntil}" headerText="EXPIRY DATE"&gt; &lt;p:cellEditor&gt; &lt;f:facet name="output"&gt; &lt;h:outputText value="#{customer.validUntil}"/&gt; &lt;/f:facet&gt; &lt;f:facet name="input"&gt; &lt;p:inputText value="#{customer.validUntil}"/&gt; &lt;/f:facet&gt; &lt;/p:cellEditor&gt; &lt;/p:column&gt; &lt;p:column sortBy="#{customer.status}" filterBy="#{customer.status}" headerText="STATUS"&gt; &lt;p:cellEditor&gt; &lt;f:facet name="output"&gt; &lt;h:outputText value="#{customer.status}"/&gt; &lt;/f:facet&gt; &lt;f:facet name="input"&gt; &lt;p:inputText value="#{customer.status}"/&gt; &lt;/f:facet&gt; &lt;/p:cellEditor&gt; &lt;/p:column&gt; &lt;p:column headerText="CREATION DATE" sortBy="#{customer.creationDate}" filterBy="#{customer.creationDate}"&gt; &lt;f:facet name="output"&gt; &lt;h:outputText value="#{customer.creationDate}"/&gt; &lt;/f:facet&gt; &lt;/p:column&gt; &lt;p:column headerText="LAST UPDATE DATE" sortBy="#{customer.lastUpdateDate}" filterBy="#{customer.lastUpdateDate}"&gt; &lt;f:facet name="output"&gt; &lt;h:outputText value="#{customer.lastUpdateDate}"/&gt; &lt;/f:facet&gt; &lt;/p:column&gt; &lt;p:column headerText="Options"&gt; &lt;p:rowEditor/&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; &lt;!-- End of dataTable (customer datatable) --&gt; </code></pre> <p>And the function for handling the rowEvent is specified in the bean as </p> <pre><code> public void custRowEdit(RowEditEvent event){ Customer cust = (Customer) event.getObject(); EntityManagerHelper.beginTransaction(); custDao.update(cust); EntityManagerHelper.commit(); } </code></pre> <p>However , on an update event , when I am editing the cell in the table , I do not get the new updated value of the attribute . <img src="https://i.stack.imgur.com/c6cFC.png" alt="enter image description here"></p> <p>Like in the image below , when I edit the status of the entry with ID 1 from 11 to 4 , in the function custRowEdit , when I try to get the customer object , I still get the status of the customer as 11 and not 4 . </p> <p>Can anyone help me with understanding why the value of the cell is not being set ? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload