The Widget Virtual Mode

The standard userexits of the module iwf and the functions in the module wdh provide you numerous functions to interactively create and manage widgets and their data. To allow you to use this functionality in batch-controlled operation, too, you have to secure that the created objects remain in the background and no interactive dialog is started.

You get into this program state setting the widget virtual mode using the function dal_wdg_set_vir. If you create widgets in widget virtual mode, DataView prevents them from being displayed on the screen. In contrast to interactive mode a widget created in virtual mode is not active after it has been created. You have to explicitly activate it with the function dal_wdg_act_vir. Only then you can edit the data in the widget via program functions that correspond to the standard functions of interactive mode. The following sections will tell you how to read, edit, create, or delete records in virtual widgets.

If you finished working at the virtual widget, you have to delete the virtual widget and deactivate widget virtual mode with the function dal_wdg_set_vir. DataView then returns to the interactive dialog an and restores the state of the user interface before widget virtual mode.

When working with virtual widgets, carefully check whether DataView is to call the userexits at the triggers of the mask in the virtual widget in widget virtual mode, too. You can suppress the userexit calls. To do so, use one of the following methods:

set userexit names at triggers to zero :
With the function dal_mas_set_x_mas you can reset all userexits names at the triggers after creating the mask in the local data structure (not in the data base data model) by passing an empty string (" "). DataView will then not execute any functions when passing the trigger. The userexit name at the pre_mask-trigger does not have to be set to zero, because DataView never examines this trigger in widget virtual mode.

check for widget virtual mode:
In the userexit, you can use the function dal_wdg_ret_vir to check whether the system is in widget virtual mode. A corresponding program branch then allows you to suppress execution of special functions in the userexit.

Error messages which DataView outputs in the message window when editing widget data in interactive operation can be blocked in batch mode with the function dal_mes_xof. Using dal_mes_xon you reactivate output of error messages.

To be able to watch all actions in widget virtual mode during the test phase of programming on the screen you have the possibility to use the function dal_wdg_set_vir to set virtual debug mode. DataView then shows the virtual widget, which is normally invisible, on the screen. Thus you can see all changes to the data in the widget.