Portlet Factory, Version 6.1.2


 

Formatting and validating form values

The Data Field Modifier builder, in conjunction with methods in a Java class, allows you to alter the format of field values as they are displayed or stored as data and provides for server-side validation of input values. The methods used to perform the formatting and validating are defined in a Java> com.bowstreet.methods.IInputFieldFormatter interface.

To change the display format, data format, and/or validation method for one or more fields:

  1. Create a formatter >com.bowstreet.methods.IInputFieldFormatter interface. Add the methods and format expressions that perform the desired transformations between formats.

  2. Add a Data Field Modifier builder call to your model, specifying the following input values:

    Fields

    Use the chooser to select one or more fields on which the specified formatting methods will operate.

    Formatter Class

    Enter the fully-qualified name of the formatter class you created.

    Format Expression

    Choose one of the listed format expressions. These format expressions are specified in the formatter class and correspond to a method in that class. This method changes the format of the field as it is stored in the data to make it more readable or fulfill some other display requirement.

    Translate Expression

    Choose one of the listed translate expressions. These translate expressions are specified in the formatter class and correspond to a method in that class. This method changes the format of the field value as it is entered by the user to one specified by the schema or some other data storage requirement.

    Validate Expression

    Choose one of the listed validate expressions. These validate expressions are specified in the formatter class and correspond to a method in that class. This method changes the format of the field as it is stored in the data to make it more readable or fulfill some other display requirement.

  3. Run the model.

Parent topic: Overview: creating forms Parent topic: About creating a formatter class


Library | Support |