(BETA) Evaluates JavaScript expressions. More...
Import Statement: | import ArcGIS.AppFramework.Scripting 1.0 |
Properties
- errorString : string
- expressionString : string
- isLiteralValue : bool
- literalValue : var
- notifyOnValueChange : bool
- scope : object
- script : QQmlScriptString
- text : string
Signals
Methods
Detailed Description
The Expression component evaluates JavaScript expressions within a QML context.
The following code snippet evaluates the expression "a * b", where 'a' is counting up from 1 and 'b' is set to 1000. The code uses the PropertySet component to define the QML context where 'a' and 'b' are taken from, and you will get notifications of the expression changing because of either 'a' or 'b'.
Item { Label { id: results } Expression { id: expression onValueChanged: results.text = expression.evaluate(); } PropertySet { id: propertySet } Timer { id: timer repeat: true interval: 1000 onTriggered: propertySet.a++; } Component.onCompleted: { propertySet.a = 1; propertySet.b = 1000; expression.scope = propertySet; expression.text = "a * b"; results.text = expression.evaluate(); expression.notifyOnValueChange = true; timer.start(); } }
Property Documentation
Contains the error string reflecting any problems encountered in evaluating the expression.
Returns true if the script supplied to the component contains an undefined, null, boolean, string, or number value. Otherwise, returns false.
Returns the script expressed as an undefined, null, boolean, number, or string value.
Indicates whether the app will provide notifications of the expression value changing due to one of its dependent values changing.
Signal Documentation
Signal emitted when the resulting value of the JavaScript expression has changed.
Note: The corresponding handler is onValueChanged
.