DEPENDENCY keyword
Applies To
Component data-binding specifications, list-source specifications, and derived values
Component property: Various
Description
Forces a keyword specification to be evaluated on a change in the value of specified properties, variables, or components.
Syntax
keyword( ) DEPENDENCY( [ “PROPERTY”( ) ] [ “VARIABLES”( ) ] “[COMPONENTS”( ) ] )
Part | Description |
keyword( ) | A specification that is to be evaluated on any change in the value of the properties, variables, or components specified as parameters to DEPENDENCY. Keyword examples: “SUM”, “COLLECTION”, and “SCRIPTS”. |
Remarks
A substitution keyword that evaluates to an empty string. Use the DEPENDENCY keyword in component data-binding specifications and other specifications to update a value when another value changes. The keyword specification to which the DEPENDENCY keyword applies updates immediately after the change occurs.
Examples
The following example is a data-binding specification for a read-only component. The SUM keyword is evaluated on any change in the value of the property AbcRank. Without the DEPENDENCY keyword, SUM would be evaluated only when the “StdFormLoadDerivedValues” event was generated.
SUM(PROPERTY(AbcRank)) DEPENDENCY(PROPERTY(AbcRank))
In the following derived-value specification, the script MyCalcScript is run on any change in the variable CalcInputVar or in the value of the component CalcInputComponent.
SCRIPTS(MyCalcScript) DEPENDENCY(VARIABLE(CalcInputVar) COMPONENTS(CalcInputComponent))
The next example is a list-source specification. If the target of the dependency changes, the list values will be retrieved again the next time the user displays the list.
STDOLE Acme.UserDefinedTypes(PROPERTIES(Name, Description)) DEPENDENCY(V(Var1) C(TypeName))