Note that there are some explanatory texts on larger screens.

plurals
  1. POp:dialog shows empty values when when I go to the next page of the p:datatable using paginator
    text
    copied!<p>I have been using onEdit in the p:datatable and it works fine.My data table has a pagintor and shows 5 records per page.so when I click on the onEdit in the first page event.getObject gets the changed value in the bean.Now when I go the next page the event.getObject does not work and returns the old value only.</p> <p>Same with the dialog box.In the table I have a link when clicked opens a dialog box in whcih I am populating few fields with the values from the row selected.It works fine in the first page and When I navigate to other pages gives empty values.</p> <p>Here is my jsf code:</p> <pre><code> &lt;p:dataTable value="#{mybean.userList}" var="item" id="dataTab" widgetVar="usersTable" tableStyleClass="data" paginator="true" rows="5" filteredValue="#{userController.filteredUsers}" editable="true" rowKey="#{item}" &gt; &lt;p:ajax event="rowEdit" listener="#{mybean.onEdit}" update=":userForm:growl" /&gt; &lt;p:ajax event="rowEditCancel" listener="#{mybean.onCancel}" update=":userForm:growl" /&gt; &lt;f:facet name="header"&gt; &lt;p:outputPanel&gt; &lt;h:outputText value="Search all fields:" /&gt; &lt;p:inputText id="globalFilter" onkeyup="('usersTable').filter()" style="width:150px" /&gt; &lt;/p:outputPanel&gt; &lt;/f:facet&gt; &lt;p:column sortBy="#{item.firstName}" filterBy="#{item.firstName}" filterMatchMode="startsWith"&gt; &lt;p:cellEditor&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="First Name" /&gt; &lt;/f:facet&gt; &lt;f:facet name="output"&gt; &lt;h:outputText value="#{item.firstName}" /&gt; &lt;/f:facet&gt; &lt;f:facet name="input"&gt; &lt;p:inputText value="#{item.firstName}" style="width:100%"/&gt; &lt;/f:facet&gt; &lt;/p:cellEditor&gt; &lt;/p:column&gt; &lt;p:column sortBy="#{item.lastName}" filterBy="#{item.lastName}" filterMatchMode="startsWith"&gt; &lt;p:cellEditor&gt; &lt;f:facet name="header"&gt; &lt;h:outputText value="Last Name" /&gt; &lt;/f:facet&gt; &lt;p:column headerText="Update" style="width:6%"&gt; &lt;p:rowEditor /&gt; &lt;/p:column&gt; &lt;/p:dataTable&gt; &lt;p:dialog id="modalDialog" header="Delete User?" modal="true" resizable="false" draggable="false" widgetVar="delUserConf" &gt; &lt;h:panelGrid id="display" columns="2" style="width: 150px;"&gt; &lt;h:outputLabel value="Firat Name" style="font-weight: bold"/&gt; &lt;h:outputText value="Last Name" style="border: none"/&gt; &lt;/h:panelGrid&gt; &lt;/p:dialog&gt; </code></pre> <p>Here is the code in my bean for the edit functionality:</p> <pre><code>public String onEdit(RowEditEvent event) { User user=(User)event.getObject()); user.getFirstName(); } </code></pre> <p>I did not add the link that I have in my form which pops up the dialog.Also I read that this might be because of Lazy loading and I am not sure about it.I am populating my table with a list and not the model.</p> <p>Could you let me know what should I do to make it work?</p>
 

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