immediate-attribute

JSF datatable: adding and removing rows clear rows values

余生长醉 提交于 2019-12-07 06:11:24
问题 I have a h:datatable showing a list of rows, and the fields of each row are input fields. I render an "Add Row" button before the table, and a "Remove Row" button on each row of the table. The baking bean is viewScoped, and the buttons add/remove elements from the java list in the backing bean, and then return to the same view. I set the immediate attribute to "true" in the buttons in order to not validate the input fields when I add or remove a row. Everything works ok but one thing: the

JSF datatable: adding and removing rows clear rows values

空扰寡人 提交于 2019-12-05 09:47:05
I have a h:datatable showing a list of rows, and the fields of each row are input fields. I render an "Add Row" button before the table, and a "Remove Row" button on each row of the table. The baking bean is viewScoped, and the buttons add/remove elements from the java list in the backing bean, and then return to the same view. I set the immediate attribute to "true" in the buttons in order to not validate the input fields when I add or remove a row. Everything works ok but one thing: the values of the input fileds are cleared. I thought that the view kept the values beacuse the bean is

Should immediate=“true” never be used when dealing with an AJAXified JSF 2.0 component?

天大地大妈咪最大 提交于 2019-11-30 08:27:08
问题 Should immediate="true" never be used when dealing with an AJAXified JSF 2.0 component? The example might be: If I want to implement a "Cancel" button on JSF 2.0 page where if the user hits "Cancel", no validations should run, should I set immediate="true" on the component if it is an ajaxified component or should specify that no components on the form should be processed? If so, what is the way to implement this functionality using the AJAXified features of the component and not the "old way

Should immediate=“true” never be used when dealing with an AJAXified JSF 2.0 component?

狂风中的少年 提交于 2019-11-29 06:40:36
Should immediate="true" never be used when dealing with an AJAXified JSF 2.0 component? The example might be: If I want to implement a "Cancel" button on JSF 2.0 page where if the user hits "Cancel", no validations should run, should I set immediate="true" on the component if it is an ajaxified component or should specify that no components on the form should be processed? If so, what is the way to implement this functionality using the AJAXified features of the component and not the "old way" of using immediate="true" ? Indeed, the purpose of using immediate="true" on a cancel button has

JSF skip Required-Validation without immediate=true

£可爱£侵袭症+ 提交于 2019-11-27 17:36:23
I have multiple forms, where I have mandatory fields and optional fields. To submit such a form I require the validation on the required-attribute to be executed, which works fine. To cancel such a form I use the attribute immediate="true" on the p:commandbutton , which makes its action happen during the Apply Request Values -Phase as addressed here: How to skip validation when a specific button is clicked? However, for large forms I want to provide the user with a Save-Button, so he can proceed later. For just saving the current state I also want to ignore the validation of the required

JSF skip Required-Validation without immediate=true

断了今生、忘了曾经 提交于 2019-11-26 19:06:07
问题 I have multiple forms, where I have mandatory fields and optional fields. To submit such a form I require the validation on the required-attribute to be executed, which works fine. To cancel such a form I use the attribute immediate="true" on the p:commandbutton , which makes its action happen during the Apply Request Values -Phase as addressed here: How to skip validation when a specific button is clicked? However, for large forms I want to provide the user with a Save-Button, so he can

Why was “immediate” attribute added to the EditableValueHolders?

北城余情 提交于 2019-11-26 09:57:41
问题 Initially immediate flag was only intended for ActionSource interface. But later on it was added to the EditableValueHolder interface also. What was the reason for design decision ? 回答1: It's to be used to prioritize validation on several EditableValueHolder components in the same form. Imagine a form containing input components with immediate="true" as well as input components without this attribute. The immediate inputs will be validated during apply request values phase (which is one phase

Trying to understand immediate=“true” skipping inputs when it shouldn't

*爱你&永不变心* 提交于 2019-11-26 01:43:16
问题 Just when I thought I had understood immediate... *sigh* Consider the following JSF page: <h:inputText value=\"#{testBean.text}\" required=\"true\" /> <h:commandButton actionListener=\"#{testBean.doFoo}\" value=\"Do Foo\" /> <h:commandButton immediate=\"true\" actionListener=\"#{testBean.doBar}\" value=\"Do Bar\" /><br /> <h:outputText value=\"#{testBean.didSomething}\" /> And this backing bean: public class TestBean { private String didSomething = \"Nothing done yet\"; // + getter public