Difference between revisions of "OnChange attribute"

Line 4: Line 4:
  
  
'''OnChange attribute''': When a user changes an input, the <code>Definition</code> attribute is updated with the new value and the <code>OnChange</code> attribute is evaluated. This provides an opportunity for your interface to make adjustments to the value just entered, or to other input fields, based on the value entered.  
+
'''OnChange attribute''': When a user changes an input, the [[Definition]] attribute is updated with the new value and the <code>OnChange</code> attribute is evaluated. This provides an opportunity for your interface to make adjustments to the value just entered, or to other input fields, based on the value entered.  
  
You can use the <code>OnChange</code> attribute to trigger evaluation when an input node such as a '''Choice''' control, '''Checkbox '''or textual entry field is changed.
+
You can use the <code>OnChange</code> attribute to trigger evaluation when an input node such as a [[Choice]] control, [[Checkbox]] or textual entry field is changed.
  
To set the <code>OnChange</code> attribute, you must first make it visible by turning it on in the '''Attributes '''dialog, found on the '''Objects '''menu. Once this is turned on, the attribute appears in the '''Attribute Panel '''and in the '''Object Window '''for objects that have input nodes or have an <code>OnChange</code> that is set.
+
To set the <code>OnChange</code> attribute, you must first make it visible by turning it on in the [[Attributes dialog]], found on the [[Object menu]]. Once this is turned on, the attribute appears in the [[Attribute panel]] and in the [[Object window]] for objects that have input nodes or have an <code>OnChange</code> that is set.
  
 
<code>OnChange</code> accepts an expression, using the same syntax as the <code>Definition</code> attribute; however, unlike a <code>Definition</code>, it also allows you to change other variable definitions or attributes using the assignment operator, :=. It can even be used to change the definition of its own variable. For example, you can set <code>OnClick</code> for variable <code>X</code> to
 
<code>OnChange</code> accepts an expression, using the same syntax as the <code>Definition</code> attribute; however, unlike a <code>Definition</code>, it also allows you to change other variable definitions or attributes using the assignment operator, :=. It can even be used to change the definition of its own variable. For example, you can set <code>OnClick</code> for variable <code>X</code> to
Line 15: Line 15:
 
If a user enters a number, expression or something else, this will immediately convert it to text.
 
If a user enters a number, expression or something else, this will immediately convert it to text.
  
For a '''Choice '''input, the <code>OnChange</code> attribute triggers when a new choice is selected. For a '''Checkbox''', it triggers when the check is toggled. For a '''Table''', it triggers after all changes to the table are accepted, such as when you press the green check or close the edit table window. <code>OnChange</code> also triggers when its <code>Definition</code> is changed by the assignment operator, which may happen from the <code>OnChange</code> attribute of another variable.
+
For a '''Choice '''input, the <code>OnChange</code> attribute triggers when a new choice is selected. For a [[Checkbox]], it triggers when the check is toggled. For a '''Table''', it triggers after all changes to the table are accepted, such as when you press the green check or close the edit table window. <code>OnChange</code> also triggers when its [[Definition]] is changed by the assignment operator, which may happen from the <code>OnChange</code> attribute of another variable.
  
 
==See Also==
 
==See Also==
 
* [[Choice]]
 
* [[Choice]]
 +
* [[Checkbox]]
 
* [[Attributes]]
 
* [[Attributes]]
  
 
<footer>User inputs and outputs as aliases / {{PAGENAME}} / Button creation</footer>
 
<footer>User inputs and outputs as aliases / {{PAGENAME}} / Button creation</footer>

Revision as of 18:26, 13 May 2016


OnChange attribute: When a user changes an input, the Definition attribute is updated with the new value and the OnChange attribute is evaluated. This provides an opportunity for your interface to make adjustments to the value just entered, or to other input fields, based on the value entered.

You can use the OnChange attribute to trigger evaluation when an input node such as a Choice control, Checkbox or textual entry field is changed.

To set the OnChange attribute, you must first make it visible by turning it on in the Attributes dialog, found on the Object menu. Once this is turned on, the attribute appears in the Attribute panel and in the Object window for objects that have input nodes or have an OnChange that is set.

OnChange accepts an expression, using the same syntax as the Definition attribute; however, unlike a Definition, it also allows you to change other variable definitions or attributes using the assignment operator, :=. It can even be used to change the definition of its own variable. For example, you can set OnClick for variable X to

X := "" & (Definition of X)

If a user enters a number, expression or something else, this will immediately convert it to text.

For a Choice input, the OnChange attribute triggers when a new choice is selected. For a Checkbox, it triggers when the check is toggled. For a Table, it triggers after all changes to the table are accepted, such as when you press the green check or close the edit table window. OnChange also triggers when its Definition is changed by the assignment operator, which may happen from the OnChange attribute of another variable.

See Also

Comments


You are not allowed to post comments.