Doubt on immediate attribute for command button
HI,
I have a doubt on setting the immediate attribute for the command button. I wou开发者_高级运维ld like to know what will be the changes in the life cycle?
I have read that setting immediate attribute will call the action listener or action methods in the apply request values phase. My doubts is it only the difference of preponding the phase. Also it will execute the all the business logic in the action methods regardless of setting the immediate attribute.
Please clarify my doubts.
If immediate="true"
is set in an UICommand
component, then the apply request values phase until with update model values phases will be skipped for any of the UIInput
component(s) in the same UIForm
. Use this to skip the entire processing of the form. E.g. "Cancel" or "Back" button.
If immediate="true"
is set in both UIInput
and UICommand
components in the same UIForm
, then the apply request values phase until with update model values phases will be skipped for any of the UIInput
component(s) in the same form which does not have this attribute set. Use this to skip the processing of the entire form expect for certain fields (with immediate). E.g. "Password forgotten" button in a login form with a required but non-immediate password field.
See also
- Debug JSF lifecycle
精彩评论