Set properties for page automation elements

 

Page automation elements from builders such as Data Page, Data Column Modifier, or Rich Data Definition, have generic properties associated with them. They are used for a number of internal processes, generally carrying information about how the page should be rendered or how certain methods should be called. In some scenarios, you might need to set these properties at runtime. For example, to highlight fields on a data entry page that have validation errors, you could change the CSS class of the field label to render in a different color or font. These can be set by assigning the LabelClass_NoError and LabelClass_Error properties to the field.

Most properties can be inherited, so it is possible to set the properties on a container and that value will be used for all sub-containers and fields within that container. In any element, there are actually two sets of properties, the local ones (that apply only to that element) and the ones that will be inherited by children. To set a property that will apply to a container and to its children, you have to put the property into both lists.

We can set page automation properties in one of three ways:

  1. Programmatically, using the setProperty() or setLocalProperty() method of DataDefinitionElement.

  2. Using a Rich Data Definition file.

  3. Using a Data Field Modifier builder in the properties section in the Advanced group.

Here are some common properties that we can set.

ColumnWidth

Determines the width of a column, for example, 24px or 1.4in. This property must be placed on a leaf node in a table.

ColumnAlignment

Determines how the content of a table column is aligned. Indicate either left, right, center. This property must be placed on a leaf node in a table.

ResourceKeyPrefix

Indicates a prefix to use when looking for a key in the resource bundle.

InferInputType

Boolean that indicates whether control type should be inferred from the HTML. The default is true.

ActionType

Determines the type of behavior of the action of a button, image button, or link. Possible values are form, link, or script.

IsModelAction

Determines whether the action is a model action. Specify either true or false.

RenderOuterPage

Determines whether action control should reinvoke the page after invoking the action. Specify either true or false.

OptionsSource

Indicates the name of a lookup table for text, select, and radio button group controls.

NoAssignIfValidationError

Boolean that indicates whether the assign part should be skipped if validation fails (in SaveData method).

PutAssignInTryCatch

Boolean that indicates if assignment code (in SaveData method) should be wrapped by try and catch blocks.

AppendBadValueToErrorMessage

Boolean that indicates whether to append a user's value when validation fails.

TranslateHTMLLabels

Boolean that indicates whether labels should go through ResourceBundle translation even though they were on original HTML

LabelClass_NoError

Indicate the CSS class to render a field in a form that does not contain errors.

LabelClass_Error

Indicate the CSS class to render a field in a form that contains errors.

RequiredPrompt

Value of this property is a String used to indicate required fields.