Immediate Attribute
I understand that the immediate attribute when it is set to true plays a diifferent role when it is part of an inputText or of a commandButton.
For example if I the inputText has a required="true" and an immediate="true" the validation will happen and I will see an message of is Required when I submit the form.
On the other side if the immediate="true" is an attribute of the h:commandButton (the button that submits the form) the validation will not happen.
Am I correct?And if I am why should I ever use the immediate="true" in a component othet that button, what it will offer me?
Thanks in advance.
[635 byte] By [
juanitaJa] at [2007-11-26 16:32:24]

# 3
You want to know when and why to use this attribute? Well .. Use it if you want to skip validation and/or don't want the values being submitted. For example, pagination button, cancel button, skip button, next button, navigation button, etc.
# 5
Using immediate means the component value will be validated during apply-request-values, ie before any non-immediate component values (which validate in process-validations).
Using immediate causes the component ActionListener or action-method to be executed at the end of the apply-request-values phase, ie before any non-immediate value validation and before any backing bean updates (update-model phase).
# 6
So if I have the immediate="true" in a selectOneMany component that onchange submits the form and above this component I have an inputText component with attribute required="true" the validation for the inputText will occur earlier than if I did not have the immediate="true" in
the selectOneMany correct?So what will this offer to me?
# 8
Thank you lllu, I was thinking of that discussion.
Juanita, everyone here has given you good advice on the immediate attribute. So keep it all in mind. I'm going to try and answer your question directly.
The immediate attribute on UIInput is used, typically, when you submit the form from the component. Usually when you have a valueChangeListener that you want invoked "immediately" when a change occurs. Thus, it will run before all the other components (without immediate="true") get validated. So then all the other components on your page can't stop the valueChangeListener from running (due to validation errors).
It looks like you understand the usage of immediate="true" on the UICommand components.
CowKing