File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Issues with scope: JSF-Primefaces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Issues with scope: JSF-Primefaces" Watch "Issues with scope: JSF-Primefaces" New topic
Author

Issues with scope: JSF-Primefaces

nidheesh ep
Greenhorn

Joined: Nov 14, 2011
Posts: 8
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

Joined: Jul 14, 2010
Posts: 754

Where is the delete function in the page and the MB?


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
nidheesh ep
Greenhorn

Joined: Nov 14, 2011
Posts: 8
Delete function is in other class. EmployeeView.jsf
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 1012
    
    5

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

Joined: Nov 14, 2011
Posts: 8
Delete method:

Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2497
    
    8

s.id=: userId


Check the blanks.


OCUP UML fundamental and ITIL foundation
youtube channel
nidheesh ep
Greenhorn

Joined: Nov 14, 2011
Posts: 8
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

Joined: Jul 14, 2010
Posts: 754

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).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issues with scope: JSF-Primefaces