Documentation
UpdateFormField
Require: Symcon >= 5.2
bool UpdateFormField (string $Field, string $Parameters, mixed $Value)
Parameters
| Field | Name of the form field to be changed |
| Parameters | Name of the parameter to be changed |
| Value | New value of the parameter |
Returns
If the command succeeds, it returns TRUE, otherwise FALSE.
Description
This function sets the parameter Parameter of the form field named Field to the value Value in every open instance configuration of this instance. If a form field with this name exists in the element and action areas, both are updated.
A change to the value of a form field in the elements area is treated as an unsaved configuration change. The console therefore displays the row for applying or discarding changes if the associated module has a property with the same name as the form field.
It is not possible to change the Name and Type parameters of form fields. Other parameters that cannot be changed are listed in the respective documentation.
For complex parameters, i.e. lists or objects, the new value must be passed in JSON-encoded form.
Example
// hide the button
$this->UpdateFormField("MyButton", "visible", false);