Choosing builders that control the validation, formatting, labels, and behavior of data fieldsAdded by IBM on August 31, 2010 | Version 1 (Original)
|These builders 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).
|The Data Field Settings builder or the Data Field Modifier (DFM) builder can help with these tasks. Using the Data Field Settings builder, you can take advantage of definitions in the default base rich data definitions (RDD) file or change the default RDD file used in the model. The RDD file lets you reuse a single shared library of common field types. You can change both field display and field validation settings for one page or selected pages in the model. Use this builder to make general changes limited to a few settings.|
The Data Field Modifier builder is available to control all the possible data field and validation settings for your model. Use the Data Field Modifier builder for detailed customization of specific page elements.
|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 Data Field Settings 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 Data Field Settings builder can also be used for some of the functionality provided by Data Field Modifier. Note that some of the features available in the RDD files are not available in a 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:
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.
- 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.
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 Field Settings and Data Column Modifier builders can be used to specify field labels.
Parent topic: Choosing builders for common tasks: wpf7