This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Issues with scope: JSF-Primefaces

 
nidheesh ep
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to implement sort functionality on primefaces dataTable.Sorting is working. But when I delete, update the dataTable items ,no effect (nothing changes) in dataTable. But in the database delete,update are occurring with out any issue.When I logged out and re-login, new list(dataTable) is fine.

employeeView.jsf:


EmployeeList.java:



I have tried with @RequestScope,@ViewScope etc.But no effect.Where I went wrong?

Primefaces-3.0.M3 with JSF2 and Google Cloud SQL
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the delete function in the page and the MB?
 
nidheesh ep
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Delete function is in other class. EmployeeView.jsf
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nidheesh

I have the same as Herbert does. Cannot see anything you have posted which is attempting to delete a row from the data table.
 
nidheesh ep
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Delete method:

 
Jan Cumps
Bartender
Posts: 2584
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
s.id=: userId


Check the blanks.
 
nidheesh ep
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jan Cumps,

Thanks for that, but It was a mistake got while editing here. Actually delete functionality is working properly in the back end/database. But some cache is the problem.That is why the dataTable is not updating or refreshing. When I logged out and re-login again, the dataTable is fine updated.I don't know where is the cache problem..
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do your ManagedBean delete method looks like:

And in your page button call an action not an actionListener (if you are using p:commandButton do it with ajax=false).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic