I was reading Core JavaServer Faces and I was working on Event Handling. It says that if immediate=true for a component(lets say for a button), when we click that button, the process validation, and invoke application faces of the JSF life cycle will be done early. What does it mean? Can any body explain to me what the immediate=true will affect in each phases? I am confused.
Thank you.
With immediate="true" on the button, the action is indeed invoked during apply request values phase and all the remaining phases are skipped. That's also the sole point of this attribute: process (decode, validate, update and invoke) the component immediately during apply request values phase.
The immediate attribute can be used to achieve the following effects: Allow a commandLink or commandButton to navigate the user to another page without processing any data currently in input fields of the current screen. In particular, this allows navigation to occur even when there are currently validation errors.
The following link most clearly demonstrates the JSF Lifecycle Phases, How to Debug them, and how immediate=true affects this.
http://balusc.blogspot.com/2006/09/debug-jsf-lifecycle.html#AddImmediateTrueToUIInputOnly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With