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 refresh data in session jsf2, primeface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "refresh data in session jsf2, primeface" Watch "refresh data in session jsf2, primeface" New topic
Author

refresh data in session jsf2, primeface

doinigly jaquel
Greenhorn

Joined: Aug 08, 2012
Posts: 6
I have two xhtml pages : the first allow to store new order, the second allow to list all of orders stored in the database.

For specific purposes, I have sessionManeged in the second page and the problem is when I save a new order and I go in the second page it doesn't get refresh because data are stored in sessions.

Can you suggest me a method to refresh data (re_run query to database) when a new order is stored?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

The standard JSF navigation mechanism is designed to do that. Inject the backing bean for the second page into the backing bean for the first page as a Managed Property.

When the action method for the first page is invoked in the backing bean for the first page, have that backing bean invoke a setup method in the second bean. That setup method can then fetch the data.

When the action method returns to the JSF Controller with the navigation rule, the second page will be displayed and its backing bean will contain the desired values.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: refresh data in session jsf2, primeface