Add a Property Change Script
- To add a property change script to a property, right click on the property Property Editor and select Add Change Script...
- The Edit Property Change Script screen is displayed.
Type in the script that you want to run and click OK.
Property Change Arguments
|self||A reference to the component that has the property in question. If the property change script is on a session property, the session object will be passed.|
|previousvalue||The previous value, as a qualified value object. Qualified value objects have a value, quality, and timestamp.|
|currentValue||The new value, as a qualified value object. Qualified value objects have a value, quality, and timestamp.|
The origin of the property value, as a unicode string. The origin parameter will take on one of six types depending on how the property value is being updated:
Change Script Example
- Place a Text Field component and Label component on a Perspective View.
- Select the Text Field component then right click on the text property. Click on Add Change Script.
The Edit Property Change Script screen is displayed. Enter the following script, which will write the current value of the Text Field component to the Label component.
- Click OK to commit the script. You'll see that the Property Editor now shows a Change Script
- Save your project.
- In a Perspective Session, enter some text into the Text Field component and hit Return. You'll see that the contents are repeated to the Label component.