Control Modify (Magic xpa 3.x)
The Control Modify event is raised when the pressing of a key modifies the value of the control. This lets you write logic after a key is pressed in a control.
The new value of the control is available via the EditGet function. Referring to the control’s variable will show the old value of the control.
This event enables you to write logic to be executed when a control value is changed: after a key is pressed or a value is changed using the mouse, even without leaving the control.
For multi-selection controls:
-
In Rich Client tasks, the event is raised after each selection.
-
In Online tasks, the event is raised when leaving the control. The event will not perform recompute.
This event does not work for .NET controls and does not work in Browser tasks.
To enable a Button control when there is a value in an Edit control, perform the following:
-
Define a logical variable and name it EnableButton.
-
Use this variable as the Enabled property for the Button control.
-
In the Edit control, define a handler for the Control Modify internal event .
-
In the handler, update the EnableButton variable with the condition: EditGet()<>''
When running the program, the Button control will be disabled when the Edit control is empty, and enabled when the Edit control is not empty.
Platform specific: For Android and iOS devices, any operations executed in this event will not show the spinner. This was done so that you can continue writing characters during the execution of these operations. Android and iOS support – Since version: 2.5
How Do I Set Logic to Be Executed When the End User Writes Data in a Control?