f:resetValuesf:resetValues appeared since JSF 2.2 to fix a behavior that could appear under some conditions that caused some UI components to not reflect the real bean state. This Facelet can be used for non-AJAX request, if using f:ajax, just use f:ajax
forto configure which single component value you want to be reset for avoiding behavior mentioned above. Use
renderto add a list of clientId (not id as usual) to which the values would be reset. Important note: this attribute doesn't support any word for some scopes like @form, so you should add each of them. To check this behavior, follow these steps:
- Add some text in one of the fields below, then click on the Submit button
- A validation error will show up. This is expected behavior at this point.
- Now click on Reset.
actionListeneris invoked and resets both fields, so the inputText should be empty after this request, which wouldn't be true if f:resetValues was not used.
Liferay Faces Alloy 3.0.1 + Liferay Faces Bridge Implementation 4.1.0 + Showcase Common 3.0.1 + Liferay Faces Util 3.1.0 + Mojarra 2.2.17