Action: SHOW_DIALOG & CLOSE_DIALOG

SHOW_DIALOG

SHOW_DIALOG action is used to display a screen of type DIALOG (screen_type=”DIALOG”). Just like for a screen, parameters can be passed to the dialog using this action

Attributes Value Mandatory
action_name SHOW_DIALOG Yes
event_list comma separated list of events, eg: TAP Yes
target target screen name Yes
input_parameter_list comma separated parameters No
target_parameter_list comma separated parameters No

Example

In this example SHOW_DIALOG action is invoked on tapping a PUSHBUTTON.

<control appearance_name="blue_button" type="PUSHBUTTON" x="20.0" y="32.0" width="60.0"  height="10.0"
                         default_value="Show Dialog">
                        <action action_name="SHOW_DIALOG" event_list="TAP" target="dialog"
                                        input_parameter_list="" target_parameter_list="" />
        </control>

The image on left displays dialog on Android and the image on right displays image on iOS(TODO)

../_images/dialog.png

CLOSE_DIALOG

CLOSE_DIALOG action is used to close a screen of type DIALOG.

Example use case: on tapping OK button in the dialog, database is updated and CLOSE_DIALOG is called. On tapping CANCEL button, CLOSE_DIALOG action is invoked.

Attributes Value Mandatory
action_name CLOSE_DIALOG Yes
event_list comma separated list of events, eg: TAP Yes
input_parameter_list comma separated parameters No
target_parameter_list comma separated parameters No

Example

In this example, tapping of button OK closes the dialog.

<screen name="dialog" background="#003366" height="90.0" screen_type="DIALOG" width="60.0">
        <title_controls />
        <controls>
                <control type="TEXT" x="4.0" y="0.0" width="92.0" height="10.0" appearance_name="white"
                        default_value="Dialog Title" word_wrap="1" />
                <control type="TEXT" x="4.0" y="11.0" width="92.0" height="10.0" appearance_name="white"
                        default_value="This is the dialog message" word_wrap="1" />
            <control type="PUSHBUTTON" appearance_name="grey_button" default_value="OK"
                x="4.0" y="22.0" width="92.0" height="8.0">
                        <action action_name="CLOSE_DIALOG" event_list="TAP"/>
                </control>
        </controls>
</screen>