$properties

Return or set the current widget properties of a field.

PropertyValuesList = $properties {(Field {,PropertyList}) }

$properties {(Field {,PropertyList}) } = PropertyValuesList

Example: $properties(GENDER) = "LabelFont=font10;Align=left"

Parameters

Parameters
Parameter Data Type Description
Field String Field name; optional; can optionally contain a qualified field name, for example, MYFLD.MYENT. If omitted, the current field is used.
PropertyList String Uniface list of widget property names, separated by GOLD ; (;); can be a string, or a variable, function, or parameter that evaluates to a string, or a field (or indirect reference to a field)
PropertyValuesList String Associative list of Property=PropertyValue pairs (separated by GOLD ; ), where PropertyValue is the value to be assigned to the property identified by Property.

Return Values

  • Associative list containing the widget properties that have been explicitly set. The default properties, including those set in the .ini file, are not returned.
  • Empty string ("") if:
    • No widget properties have been explicitly set in the Define Properties form or with $properties.
    • An error occurred. $procerror contains a negative value that identifies the exact error.
Values of $procerror commonly returned by $properties
Value  Error constant Meaning
-1101 <UPROCERR_FIELD> An incorrect field name was provided; either the field name is not valid syntactically or the field is not available in the component.

Use

Allowed in all component types except Static Server Pages and self-contained Services.

In DSPs, $properties can only be used once (before $webdefinitions is called, when the page is initially loaded) to override the default declarative properties. It cannot be use to dynamically change the properties.

Description

Widget properties can be explicitly set declaratively in the Uniface IDE or dynamically using $properties.

At run time, all the properties associated with a widget can be changed until the form is presented to the user (with edit or display). After this point, only the widget's dynamic properties can be changed.

Setting widget properties with $properties overrides the values that have been explicitly set for those properties, whether declaratively or dynamically. Omitting a property causes that property to be reset to the default values, as determined by the Windows version and the .ini file.

Properties are reset to the compiled values each time that a component is restarted (unless the component's Component Behavior property is set to Keep component definition and data in memory). The compiled values are the default properties, plus the properties set for the entity declaratively.

You can change the properties of the widget in a single occurrence using $fieldproperties.

When changing widget properties, keep in mind that these properties sometimes interact with each other. For example, for an edit box in Microsoft Windows, setting WordWrap=True has an effect only if MultiLine=True and HScroll=False.

Using $properties in a Web application

Style references are stored as property values in the Repository, and can be manipulated with $properties and $fieldproperties. For dynamic changes to the look and feel of style attributes, use the field-level subclass property, which is checked at run time and propagated through the generated HTML. The subclass property uses predefined style references from the Cascading Style Sheet (CSS) used by the Web application. The syntax used by $properties is:

$properties(Field)="subclass=MyClass"

where MyClass is a predefined style class in the application’s CSS.

Note:  The syntax of $propertiesmust not include spaces.

Changing Font and Alignment

The following example alters the font name used for the label associated with the radio group GENDER, and makes the representation appear to the left of the button:

$properties(GENDER) = "LabelFont=font10;Align=left"

Related Topics