Portlet Factory, Version 6.1.2
Resetting a form
You can redisplay a form page, resetting the form values to their initial values. Use the pageName_Initialize method added to the WebApp by the Data Page builder call. The Data Page builder call adds this method when you use a Data Field Modifier builder call to set an initial value for one or more fields in the form.
To initialize a form, perform the following steps.
- Add a Data Field Modifier builder call to your model for each of the fields for which you want to set an initial value.
- In each Data Field Modifier call, set the Initial Value input.
- In the model action or Java code that reloads the form page, add a call to the pageName_Initialize method. For example, the following code could be used to re-initialize the form when a user clicks on a Reset button on the form.
public void resetForm(WebAppAccess webAppAccess) { webAppAccess.callMethod("myFormPage_Initialize"); webAppAccess.processPage("myFormPage"); }
Parent topic: Overview: creating forms
Library | Support |