Syntax of the TERMINATE DIALOG instruction
Terminates the instance of a declarative dialog.
Syntax
TERMINATE DIALOG dialog-name
- dialog-name is the identifier of a declarative
DIALOG
block.
Usage
The TERMINATE DIALOG
instruction stops a declarative dialog identified by the
name passed.
If the intent is to finish the parallel dialog, the corresponding window/form bound to the dialog
should be closed after TERMINATE DIALOG
.
However,
TERMINATE DIALOG
can also be used in conjunction with
START DIALOG
, to achieve a "restart" of the parallel dialog.Note:
TERMINATE DIALOG
will not raise an error, if the dialog was not
yet started with START DIALOG
.
This is required to implement the "restart" pattern.The next code example shows a typical restart pattern on a detail parallel dialog, when a new row is selected in the master list:
DIALOG d_list_view()
DISPLAY ARRAY arr TO sr.*
ATTRIBUTES(ACCESSORYTYPE=DISCLOSUREINDICATOR)
BEFORE ROW -- in BEFORE ROW, we restart the details view
CURRENT WINDOW IS w_right
TERMINATE DIALOG d_detail_view
LET curr_pa = arr_curr()
DISPLAY BY NAME arr[curr_pa].*
DISPLAY SFMT("tapped row %1",arr_curr()) TO info
START DIALOG d_detail_view
CURRENT WINDOW IS w_left
...