Oracle ADF Faces 10g: How to pass data between pages

adminTechnical TipsLeave a Comment

Oracle ADF Faces 10g: How to pass data between pages

Do you have the need to pass data between pages, e.g. for a new customer signup page flow that spans multiple pages?

In ADF Faces, when you have a form that spans multiple pages, you have options on how to pass and maintain the data between pages, e.g. cache the data in the middle tier, re-write the data into hidden fields on the page, or store the state in session.

Caching and storing data in session have the drawback of not being back-button or new-window safe. Often frameworks have a mechanism to store state in hidden fields on the page and rewrite the state into the next page’s hidden fields; however, ADF Faces does not have this mechanism.

Instead, ADF Faces ships with a cross between hidden fields and session state management where a token (i.e. a unique id) is written to a hidden field on the page and the token is the key to a value in session; this is referred to as “Process Scope”.

Each page has its own copy of the state. If the user clicks the back button to go to a previous page, they will be operating on the same state of the object in session as when that page was originally rendered.

Note—ADF Faces will store up to a set number of pages’ state in session. This value is configurable in the adf-faces.xml file.

More information can be found here:

  • http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3?topic=sf_ascopes_html
  • http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/devguide/communicatingBetweenPages.html
  • http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps%7Cadfcreate%7Caf_apageflowscope~html/
  • http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps%7Cadfcreate%7Caf_asetactionlistenerandprocess%7Ehtml/
  • http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps%7Cadfcreate%7Caf_adialogparameters%7Ehtml/

Leave a Reply

Your email address will not be published. Required fields are marked *