ui.Form.SetElementText()

The SetElementText() method is used to change dynamically static form widgets. It changes the value of the TEXT attribute of a widget. The accepts two arguments: the name of the form widget and the new value for the TEXT attribute in a form of a character string. For example you can change the text displayed by a static label in this way.

DEFINE wo ui.Window,

       fo ui.Form,

       a string

 

OPEN WINDOW w1 AT 2,2 WITH FORM "my_form"

 

LET wo = ui.window.getCurrent()

LET fo = wo.getForm()

 

CALL fo.setElementText("main_label", "New Label Text")

 

The SetFieldText() method has a synonym - SetElementText () - that is used for compatibility purpose.