'view_attributes' Setting Overview
Adding Attributes to Your Program
view_attributes defines a list of custom attributes that should be applied to the interaction or the sub-interaction. It is an optional setting.
LET <InteractForm_Settings>.attributes[Parent interaction][Attribute Name] = "<valid 4GL attribute>"
The key of the first HASHMAP is the name of sub-interaction. If a key is an empty string, attributes are applied to the main interaction (DISPLAY ARRAY or INPUT ARRAY). DISPLAY ARRAY interaction has several sub-interactions (UPDATE, INSERT and QUERY), so you need to define the name of sub-interaction for defining attributes for particular interaction.
The key of the second HASHMAP is the attribute name. And the value of second HASHMAP is the attribute value that should be applied.
Setting format:
<InteractForm_Settings>.view_attributes HASHMAP OF HASHMAP
<InteractForm_Settings> here is the settings variable name you define.
Note: Before proceeding, get acquainted with the Settings Levels section of LyciaLowCode Settings page (the concept of levels is essential for configuring multiple interactions and the multitable support).
The definitions like LET <setting_variable>.<setting_name> = <value> refer to the InteractForm_Settings level, while LET <setting_variable>.views["<db_table_name>"].<setting_name> = <value> refers to the View level.
This setting can be defined for:
InteractForm_Settings level: Yes
View level: Yes
Example (InteractForm_Settings level):
LET l_settings.view_attributes[""]["DOUBLECLICK"] = "Update" # Attribute for executing UPDATE on DOUBLECLICK
Example (Views level):
Result: After the user double-clicks any row in the table, the program is in the Edit (Update) mode:
INSERT / APPEND / DELETE actions are TRUE by default, which means that they are displayed to the program user. To remove (hide) these actions, you need to define the appropriate attributes in settings, like:
DEFINE l_settings InteractForm_Settings
LET l_settings.attributes[""]["APPEND ROW"] = FALSE
LET l_settings.attributes[""]["DELETE ROW"] = FALSE
LET l_settings.attributes[""]["INSERT ROW"] = FALSE
FUNCTION settings_list()
DEFINE l_rec_settings InteractForm_Settings
LET l_rec_settings.form_file="../settings/llc_settings_list"
LET l_rec_settings.id = "settings"
LET l_rec_settings.views["test05"].navigation_status="nav_page_of" #Display current cursor location to with label by identifier
LET l_rec_settings.views["test05"].view_attributes[""]["DOUBLECLICK"] = "Update"
#Display some information
LET l_rec_settings.views["test05"].navigation_status="nav_page_of" #Display current cursor location to with label by identifier
LET l_rec_settings.views["test05"].actions[""]["BEFORE DIALOG" ] = FUNCTION display_info
CALL InteractForm(l_rec_settings)
END FUNCTION