'view_attributes': INPUT Interaction Attributes

'view_attributes' Setting Overview

Adding Attributes to Your Program

Showing / Removing Default Events

Example Programs: db_cms_activity

'view_attributes' Setting Overview

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.

Note: Follow the link for more information about the ATTRIBUTE clause.

 

Return to top

Adding Attributes to Your Program

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):

LET l_settings.views["test05"].view_attributes[""]["DOUBLECLICK"] = "Update"

Result: After the user double-clicks any row in the table, the program is in the Edit (Update) mode:

Note: DOUBLECLICK for Update is only available in the List View (Table Display Array).
Note: Alternatively, you can specify this setting in JSON array in .fm2 form file by the following example: Defining Settings in .fm2 Form File.

 

Return to top

Showing / Removing Default Events

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

 

Return to top

Example Program db_cms_activity

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

 

Return to top

 

Contact Us

Privacy Policy

Copyright © 2024 Querix, (UK) Ltd.