ui.Form.SetFieldHidden()

setFieldHidden() is used to specify the value of the VISIBLE field attribute of the field or fields with the given name. It has basically the same effect as the Visible property of a theme file:

MAIN

  DEFINE wo ui.Window

  DEFINE fo ui.Form

  DEFINE prod_id INTEGER

  DEFINE article CHAR(20)

OPEN WINDOW orders WITH FORM "ord_list"

LET wo = ui.Window.getCurrent()

LET fo = wo.getForm()

INPUT BY NAME prod_id, article

  ON ACTION ("hide")

    CALL fo.setElementHidden("idlabel",1)

    CALL fo.setFieldHidden("products.prod_id",1)

  ON ACTION ("show")

    CALL fo.setElementHidden("idlabel",0)

    CALL fo.setFieldHidden("products.prod_id",0)

END INPUT

END MAIN

It accepts two parameters: first is the name of the field and the second is the value of the VISIBLE attribute. The value of the VISIBLE attribute can be either 0 (then the field will be visible) or 1 (then the field will be hidden).

At least one field should remain visible, otherwise, the current user interaction process will stop.

ui.Form.SetFieldHidden() has a synonym - ensureElementHidden() - used for compatibility purposes.

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.