1.

What Is The Difference Between Setting An Immediate=true On A Button And Immediate=true On A Text Field?

Answer»

When immediate is true on a button, the command’s action and ActionListeners, including the default ActionListener provided by the JavaServer Faces implementation, will be executed during Apply Request VALUES phase of the request processing LIFECYCLE, rather than waiting until the Invoke Application phase.

In case of a text field, by default, values are converted and validated together in the Process VALIDATORS phase. However, if you need access to the value of a component during Apply Request Values – for example, if you need to get the value from an actionListener on an immediate COMMANDBUTTON – then setting this to "immediate" makes that possible.

Life Cycle for Immediate="true" on input component is

 Restore View->Apply Request Values->Process Validations->Update Model->Invoke App->Render Response

Life Cycle for Immediate="true" on command component is

Restore View->Apply Request Values->Render Response.

When immediate is true on a button, the command’s action and ActionListeners, including the default ActionListener provided by the JavaServer Faces implementation, will be executed during Apply Request Values phase of the request processing lifecycle, rather than waiting until the Invoke Application phase.

In case of a text field, by default, values are converted and validated together in the Process Validators phase. However, if you need access to the value of a component during Apply Request Values – for example, if you need to get the value from an actionListener on an immediate commandButton – then setting this to "immediate" makes that possible.

Life Cycle for Immediate="true" on input component is

 Restore View->Apply Request Values->Process Validations->Update Model->Invoke App->Render Response

Life Cycle for Immediate="true" on command component is

Restore View->Apply Request Values->Render Response.



Discussion

No Comment Found