f:resetValues

f: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 resetValues attribute.

General Usage

Use for to configure which single component value you want to be reset for avoiding behavior mentioned above. Use render to 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. actionListener is 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.

    Source Code

Liferay Faces Alloy 4.1.1 + Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 4.0.0 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20