setProperties()
Sets widget properties for a Uniface data object in JavaScript.
Object.setProperties(
Properties)
Arguments
Properties—a JavaScript object with property name-value pairs
Exceptions
The following exception may be thrown:
uniface.InvalidDataObjectException
Description
The given object may specify widget properties that the Entity, Occurrence, or Field already has, in which case the property value is overwritten with the new value, or properties that the object does not yet have, in which case the object gets that additional property.
In JavaScript Object Notation (JSON), such an object is represented as:
{ "style:color" : "red", "html:title" : "incorrect value" }
The initial values of the widget properties of a field or occurrence can be set declaratively in the Properties Inspector, and procedurally in ProcScript using the following commands:
- For entities: $entityproperties and $curentproperties
- For occurrences: $occproperties
- For fields: $properties and $fieldproperties
Once the DSP is loaded, the values of these properties can be dynamically changed in the browser using the setProperty and setProperties API functions.
You can use the clearProperties function to reset all the widget properties of the object to their initial values.
Setting Properties
The following example sets the color and title properties of a widget:
vField.setProperties({"style:color":"red", "html:title":"incorrect value"})