This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Maintaining values from primefaces form after form submit  RSS feed

 
Randy Maddocks
Ranch Hand
Posts: 143
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a form containing several fields, 2 of which persist to different table in a database than the rest of the fields on the form. I have no problem persisting the data into both tables of the database, and after the form is submitted I reset the form to its default values. That all works fine.

But in the same session, when I open another form (a search form) and enter search criteria, which then displays a datatable containing the search results, those 2 values that are persisted to another table are not showing up, but the rest of the data is.

Here is the method that calls the persist methods:



Here is the method that sets the values and invokes the persist method:



If I comment out the code:


The values do show up, but the problem is, when a subsequent form is opened in the same session (e.g. a search form) the field for that value shows the actual value, instead of the field being blank.'

I am not sure why the data from the one database ("parent") is showing up, yet the data from the other database ("child") is not.

Is it something I am doing wrong? I thought by setting the setter in the child controller class back to a new instance of the Entity class (PolicyPayment) that it would reset the form to default values, but at the same time retain (or save) the inputted values in the same session.

I hope I have included enough information. Any help would be greatly appreciated. Thank you.
 
Randy Maddocks
Ranch Hand
Posts: 143
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, a typo on my part.

The line : I am not sure why the data from the one database ("parent") is showing up, yet the data from the other database ("child") is not.

Should read: I am not sure why the data from the one table ("parent") in the database is showing up, yet the data from the other table ("child") is not.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!