First page Back Continue Last page Graphics


Using Scoped Managed Bean Variables (continued)

backingBean: Used for managed beans for page fragments and declarative components only, the object is available for the duration between an HTTP request until a response is sent back to the client. This is needed because there may be more than one page fragment or declarative component on a page and to avoid collisions, any values must be kept in separate scope instances. Therefore, any managed bean for a page fragment or declarative component must use the backingBean scope.

Using Page Flow Scope

Each ADF task flow can specify a page flow scope that is independent of the memory scope for all other task flows.

When one task flow calls another, the calling task flow cannot access the called task flow’s page flow scope, so you can use page flow scope to pass data values only between activities within a task flow. Application and session scopes are also allowed within task flow definition files, but are not recommended because they may keep things in memory longer than needed.

You can bind values to pageFlowScope managed beans properties before control is passed to a called ADF bounded task flow. Values added as pageFlowScope continue to be available as the user navigates from one page to another within a task flow. This is true even if you use <redirect/>. These values are visible only in the current page flow or process. If the user opens a new window and starts navigating, that series of windows has its own process; values stored in each window remain independent. Clicking the browser’s Back button resets pageFlowScope to its original state.

Clearing pageFlowScope

This scope never clears itself. You can manually force pageFlowscope to clear, as shown in this example:

RequestContext afContext = RequestContext.getCurrentInstance(); afContext.getPageFlowScope().clear();