Monday, June 30, 2014

Scopes in ADF




6 scopes are there for ADF.

  1. Application scope
  2. Session scope : There's no window uniqueness for session scope, all windows in the session share the same session scope instance. If you are concerned about multiple windows being able to access the same object (for example to ensure that managed beans do not conflict across windows), you should use a scope that is window-specific, such as page flow or view scope.
  3. Page flow scope : EL expressions must explicitly include the scope to retrieve values. For example, to retrieve foo from the pageFlowScope scope, your expression would be #{pageFlowScope.foo}
  4. Request scope : The object is available from the time an HTTP request is made until a response is sent back to the client.
  5. Backing bean scope : Used for managed beans for page fragments and declarative components only,the object is available from the time an HTTP request is made until a response is sent back to the client. This scope is needed for fragments and declarative components because there may be more than one page fragment or declarative component on a page, and to prevent collisions, any values must be kept in separate scope instances. Therefore, any managed bean for a page fragment or declarative component must use backing bean scope. EL expressions must explicitly include the scope to retrieve values. For example, to retrieve foo from the backing bean scope, your expression would be #{backingBeanScope.foo}
  6. View scope :

ADF Page LifeCycle Stages

Some of the properties like immediate, refresh, refreshCondition, deferred can be understood better only if we have knowledge of ADF Page Lifecycle.


The flow for ADF Page lifecycle is :
Restore --> jsfRestore --> initContext --> Prepare Model --> Apply Request Values --> Process Validations 
--> Update Model  Values--> Validate Model Updates --> jsfInvoke Application --> Metadata Commit
-->  before JSF Render Response --> Prepare Render --> after JSF Render Response



  • If immediate = true : Validations, conversions and events associated with the component are processed during Apply Request Values phase. And, Process Validations, Update Model Values and Invoke Application phases are skipped.

Partial Submit v/s Auto Submit and Immediate




Partial Submit
Auto Submit
Applicable for
Command components
Input Components








Role of immediate property :
Immediate = true : Validation will be skipped. If we have 2 tabs and each tab with an input text mandatory. We have set immediate = true on both. If the user does not provide the mandatory input field and moves to next tab, the error will not be coming