Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

List

  • Last UpdatedJun 25, 2024
  • 3 minute read

Use scripts to set and get values for the properties of the List control.

Basic

Property

Scripting Supported

Example

Name

Yes

Writable

Readable

To set the property

control.findById("ID").tagName = "Value for Name";

To get the value of the property

control.findById("ID").tagName;

XML Node

Yes

Readable

To get the value of the property

control.findById("ID").xmlNodeBoundTo;

Description

Yes

Writable

Readable

To set the property

control.findById("ID").description = "Value for Description";

To get the value of the property

control.findById("ID").description;

Tooltip

No

Not Applicable

Options

No

Not Applicable

Default Value

Yes

Readable

To get the value of the property

control.findById("ID").defaultValue;

Appearance

Property

Scripting Supported

Script

Enable

Yes

Writable

Readable

To set the property

control.findById("ID").enable = true;

To get the value of the property

control.findById("ID").enable;

Visible

Yes

Writable

Readable

To set the property

control.findById("ID").visible = true;

To get the value of the property

control.findById("ID").visible;

Label Position

No

Not Applicable

Label-Control Area

No

Not Applicable

Width

No

Not Applicable

Retain Space

No

Not Applicable

Rows

No

Not Applicable

Selection Mode

Yes

Readable

To get the value of the property

control.findById("ID").selectedMode;

Custom Style Sheet Identifier

No

Not Applicable

Validation

Property

Scripting Supported

Example

Mandatory

Yes

Writable

Readable

To set the property

control.findById("ID").isMandatory = true;

To get the value of the property

control.findById("ID").isMandatory;

Advanced

Property

Scripting Supported

Example

On Data Change

Yes

For more information, see scripting guidelines for On Data Change property.

Note: If you use scripts for On Data Change property of a List control to add a record to a Base Form, then the focus will be on the first control of the Base Form.

ID

No

Not Applicable

Text Parameter

Yes

Writable

Readable

To set the property

control.findById("ID").optionText = "OText";

To get the value of the property

control.findById("ID").optionText;

Value Parameter

Yes

Writable

Readable

To set the property

control.findById("ID").optionValue = "OValue";

To get the value of the property

control.findById("ID").optionValue;

Forms 2011 Compatible

No

Not Applicable

Include in Summary

No

Not Applicable

Scripts

Property

Scripting Supported

Example

Name

Yes

return "Value for Name";

Description

Yes

return "Value for Description";

Enable

Yes

return true;

For more information, see scripting guidelines for Enable property.

Visible

Yes

return true;

For more information, see scripting guidelines for Visible property.

Mandatory

Yes

return true;

For more information, see scripting guidelines for Mandatory property.

Default Value

Yes

return "ValueOne";

OR

return "ValueOne;#ValueTwo;#ValueThree";

Note:
- If the value is not one of the values set for the Value parameter in the Options property, then that value will not be a part of the options but will be a part of the XML instance.
- If multiple values are set when the Selection Mode property is set to Single, then only the first value will be a part of the options but all values will be a part of the XML instance.
- Multiple values must be separated with ;#
- The Value script takes precedence over the Default Value script.

Value

Yes

return "ValueOne";

OR

return "ValueOne;#ValueTwo;#ValueThree";

Validate

Yes

return new ValidationOptions(false, "Error Message");

OR

return new ValidationOptions(true, "");

For more information, see scripting guidelines for Validate property.

Options

Yes

return "[{\"OValue\":\"1\",\"OText\":\"ValueOne\" },{\"OValue\":\"2\",\"OText\":\"ValueTwo\"},{\"OValue\":\"3\",\"OText\":\"ValueThree\"}]";

Here OText is the Text Parameter and OValue is the Value Parameter.

For more information, see scripting guidelines for Options property.

Note:
- Text Parameter and Value Parameter properties must be specified before using the Options property script.
- Fore Color and Back Color properties cannot be set through scripts.

Note:
- Display value is readable.
- You can retrieve the display value via script as follows:
return control.findById("ID").displayValue;

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in