Note that there are some explanatory texts on larger screens.

plurals
  1. POBean from list gets not updated in JSF
    primarykey
    data
    text
    <p>I struggled for a whole week now and dont get it work. The user objects dont get updated... Here is the important xhtml part:</p> <pre><code>&lt;p:dataTable id="usersTable" var="user" value="#{userBean.allUsers}"&gt; &lt;p:ajax event="rowToggle" listener="#{userBean.onRowToggle}" update=":form_user_management:tabView_viewUsers:messages" /&gt; &lt;f:facet name="header"&gt; User &lt;/f:facet&gt; &lt;p:rowExpansion&gt; &lt;h:panelGrid id="display" columns="2" cellpadding="10" style="width:300px;" styleClass=" ui-widget-content grid"&gt; &lt;p:panel id="panel" header="Benutzer bearbeiten"&gt; &lt;p:messages id="msgs"/&gt; &lt;h:panelGrid columns="3" &gt; &lt;h:outputLabel for="firstname" value="Firstname: *" /&gt; &lt;p:inputText id="firstname" value="#{user.userFirstName}" required="true" label="Firstname"&gt; &lt;f:validateLength minimum="2" /&gt; &lt;/p:inputText&gt; &lt;p:message for="firstname" display="icon"/&gt; &lt;h:outputLabel for="surname" value="Surname: *" /&gt; &lt;p:inputText id="surname" value="#{user.userLastName}" label="Surname" required="true"&gt; &lt;f:validateLength minimum="2" /&gt; &lt;p:ajax update="msgSurname" event="keyup" /&gt; &lt;/p:inputText&gt; &lt;p:message for="surname" id="msgSurname" display="icon"/&gt; &lt;p:commandLink id="changepw" value="Passwort ändern" onclick="dlg.show()" title="Passwort ändern"&gt; &lt;f:setPropertyActionListener value="#{user}" target="#{userBean.currentUser}" /&gt; &lt;/p:commandLink&gt; &lt;p:commandButton ajax="true" id="btnUpdateUser" value="Update" update=":form_user_management @all" actionListener="#{userBean.updateUser(user)}"/&gt; &lt;p:commandButton ajax="true" id="btnDeleteUser" value="Delete" update=":form_user_management" actionListener="#{userBean.deleteUser(user)}"/&gt; &lt;/h:panelGrid&gt; &lt;/p:panel&gt; &lt;/h:panelGrid&gt; &lt;/p:rowExpansion&gt; </code></pre> <p> </p> <p>When I click on "Save" the expanded Row disappears, but the new values are not shown and the Java Method "userBean.updateUser(user)" gets only the old values of user object.</p> <p>The head of UserBean is:</p> <pre><code>@Named @SessionScoped public class UserBean implements Serializable { </code></pre> <p>SessionScoped is from the javax.enterprise.context</p> <p>I also tried to use the old @ManagedBean things, but that didnt help either. I think the problem is located in the xhtml file and with the ajax stuff... Oh, and I use and the other template stuff. </p> <p>Using Primefaces 3.4 and Glassfish 3+</p> <p>Full UserBean: <a href="http://pastebin.com/yQCgiM4E" rel="nofollow">http://pastebin.com/yQCgiM4E</a> Full Xhtml: <a href="http://pastebin.com/19TWt3Dv" rel="nofollow">http://pastebin.com/19TWt3Dv</a> (line 110 is the interesting thing)</p>
    singulars
    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.
    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