Portlet Factory, Version 6.1.2


 

Choosing builders that control the validation, formatting, labels, and behavior of data fields

These builders control the validation, formatting, labels, and behavior of data fields.

Table 1. Builders to control the validation, formatting, labels, and behavior of data fields
Task Builder you should use
Add formatting or validation to a field or to an element in a schema. For example, you can:

  • Format the field (for example, format the data in an acceptable date format)

  • Translate an expression (for example, remove dashes from a formatted string to that it can be properly saved)

  • Validate the field being submitted (for example, ensure that the Birthday field is a date).
Although either the Data Field Modifier (DFM) builder or the Rich Data Definition (RDD) builder can help with these tasks, RDD is the best choice because you can use this builder to encode and reuse detailed field behaviors. You can enable reuse at the schema level by creating an RDD file for a particular schema, and you can also reuse a single shared library of common field types, with the "base" data definition functionality. To generate your own data definition file, use the RDD’s builder interface to set the appropriate formatting, validation, and so on. Then, scroll down to the bottom of the builder and press the Create Data Definition File button.
Make column names easier to read. For example, rather than displaying CUSTOMER_NAME, to just display the word Customer. The Data Column Modifier and the Rich Data Definition (RDD) builders can be used to change the labels that are displayed in your application. The Localized Resource builder can also be used to change column and field labels, and it can support multiple languages. It lets you pick a resource bundle, which it imports into a variable in your model. You can then use the values from that variable to localize text strings in your model, such as button or column labels. After you have added the Localized Resource builder to your model, the next step is to open up the builder that created the fields (View & Form builder or some other builder based on Data Page), and scroll down to find the Label Translation section. From there, select the locale data or resource bundle you are using.
Change the behavior of a field in a view or a form:

  • Make the field a data entry control (such as a text input, text area, select, or check box).

  • Make the field view only (for example, text or image).

  • Make the field an action field (such as a link, button, or image button).
Use the Data Field Modifier builder to change the behavior of fields created by Data Page, or any higher-level builder that uses Data Page (for example, View and Form). The Rich Data Definition (RDD) builder can also be used for much of the functionality provided by Data Field Modifier. Note that some of the features of the Rich Data Definition (RDD) builder are available in the XML files used by RDD and are not available in the RDD builder user interface.
Translate an existing value into a meaningful name. For example, instead of displaying the Department Code, to display the Department Name.

You have an edit form that allows users to select a name (like Department Name), but you want to save the associated value (like Department Code).

You want to populate a select list (or similar control) with a value that is not returned from your database, such as a blank.

The most common way to do this is by adding a Lookup Table builder to your Model. The Lookup Table builder creates a lookup table, which is used to translate between some computer-readable ID and a human-readable name, often the result of a database query. The table also caches the results across different users, including the opportunity to prevent data from becoming stale. This builder:

  • Lets you access a data source by entering an SQL statement, pointing to an XML variable, or typing in some XML.

  • Adds to the query results any name/value pairs you want to include in the select list (for example, blank).

  • Creates methods that do the translation between name/value pairs.

Next, add the relevant page control builder to your model, pointing it at the Lookup Table builder. Builders that work with Lookup Table include Data Field Modifier, Select, Text, and Radio Button Group.

You can also have the Rich Data Definition (RDD) builder (RDD) automatically create and apply a lookup table. This can be especially useful if you use the same lookup numerous times. See the help for RDD for more information

Shut off label generation. For example if one of the builders used in a Model generated a label that you do not like.

Provide my own label for the field.

The Data Field Modifier is a builder that is useful for a number of different tasks. Basically, this builder can be used to control the page elements created by Data Page builder (as well as the higher-level builders that leverage Data Page). This builder lets you select one or more fields and one or more data types (like double, string, and so on). You can then perform modifications including hiding, formatting, labeling, and determining the display of child elements.

The Data Column Modifier and Rich Data Definition (RDD) builders can be used to specify field labels.


Library | Support |