ui.Form methods

 

ui.Form methods are used to manipulate ui.Form objects at runtime.

These methods can be used to manipulate:

 

OPEN FORM statement does not create a ui.Form object.

ui.Form objects can be created by the DISPLAY FORM statement and attached to the window in which the form is displayed.

 

 

To manipulate ui.Form objects, you have to:

 

declare the object with a DEFINE statement:

 

DEFINE form_object ui.Form

 

open a form with OPEN FORM and OPEN WINDOW WITH FORM statements:

 

OPEN WINDOW my_window WITH FORM "my form" ATTRIBUTE(BORDER)

 

bind the opened form with the necessary ui.Form object:

 

LET window_object = ui.Window.getCurrent()

LET form_object = window_object.getForm()

 

 

ui.Form.loadActionDefaults()

loads the actions settings from a toolbar specified in the form file

ui.Form.loadToolbar()

loads a toolbar for the specified ui.Form object

ui.Form.loadTopMenu()

loads a top menu for the specified ui.Form object

ui.Form.setDefaultInitializer()

specifies a default initialization function that will be used to process globally all the forms opened by a program

ui.Form.setElementImage()

specifies the image for a form element

ui.Form.setElementText()

changes the text for a form element

ui.Form.setFieldHidden()

allows hiding form fields

ui.Form.setFieldStyle()

allows modifying display style of a static form widget by applying a class name to it

ui.Form.open()

opens a form from a form file

ui.Form.display()

displays a previously opened form with the specified display attributes

ui.Form.close()

closes a form opened with a ui.Form.open() method and frees the resources allocated to it

ui.Form.getHeight()

retrieves the height of the form in rows

ui.Form.getWidth()

retrieves the width of the form in columns

ui.Form.setVerticalAlignment()

specifies how an element is aligned relative to vertical borders of the parent container or cell (applied to all containers except for CoordPanel and StackPanel)

ui.Form.getVerticalAlignment()

retrieves the alignment of the specified element

ui.Form.ensureElementVisible()

ensures visibility of  the specified form element

ui.Form.ensureFieldVisible()

ensures visibility of  the specified form field