Sunday 3 April 2011

Immediate Property Behaviour between af:inputText & af:commandButton


<af:inputText>

By default values are converted and validated together in the Process Validators phase. If you setting immediate to true then value is converted and validated immediately in the Apply Request Values phase, or is handled in the Process Validators phase.

<af:commandButton>

In Command button, if you setting immediate to true will skip validation, whether data validation is client-side or server-side will be skipped when events are generated by this component.By default is immediate false.

When immediate is true, 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.

If the page contains the <af:inputText> with Immediate/Required True and <af:commandButton> with Immediate True. Now, If you invoke the command button then it trigger the required message instance of skipping the validations.

So it will trigger the validation for true-true combinations also.

You can download the sample workspace from here.
[Runs with Oracle JDeveloper 11g R1 PS2]

How to run this sample?
Run using the Immediate.jspx and check the FirstName field and Immediate True Command Button.

No comments:

Post a Comment