First page Back Continue Last page Graphics
Using the immediate Attribute
- This attribute is available as a property on UI components.
- Components that have immediate set to true are evaluated in the Apply Request Values phase.
- Use case: Enforce a component to be evaluated before others.
- The life cycle continues if no error is found.
- No updated model data is available.
- To access user-provided input, call getSubmittedValue().
- The developer has the option to short-circuit the JSF life cycle:
- A ValueChangeEvent runs before validation is performed.
- Use ValueChangeListener to call the Render Response phase.
- Update the model manually only if needed.
- Use case: Cancel button that should navigate to another page without submitting the data
Notes:
Using the immediate Attribute
In the Apply Request Values phase, each component in the tree extracts new values from the request parameters (using its decode method) and stores it locally. Most associated events are queued for later processing. If you set a component’s immediate attribute to true, the validation, conversion, and events associated with the component are processed during this phase and the life cycle skips the Process Validations, Update Model Values, and Invoke Application phases. Additionally, any associated iterators are invoked.