Theory

 


Before you proceed to the practical examples, we will explain why this interface mode is recommended.

As a rule, applications for desktop computers use modal windows. 1C:Enterprise is no exception. Modal windows are handy in scenarios where user input is required for further execution of an algorithm. Such windows block the entire applied solution interface and pause the script execution until they are closed.

But 1C:Enterprise is no longer a desktop-only application, it eventually acquired a web client and mobile device support, which introduced some issues related to modal windows.

In order to display modal windows properly, desktop browsers require specific setup, while mobile browsers do not support modal windows at all.

This is why a special interface mode that does not use modal windows is implemented in 1C:Enterprise. In this mode a window that should normally be modal is displayed within the parent window area and blocks the entire interface. From the user perspective it looks exactly like a modal window because a user cannot perform any other operations until they close the window.

But it does not work this way from the developer perspective. That "blocking window" does not pause the script execution. This means that an algorithm that was previously implemented as a solid script fragment must be divided into two parts: one part is executed before opening the window and the other one is executed when the window is closed.

To inform the platform which script should be executed once the window is closed, the name of the procedure to be executed is passed to the window.

The following example demonstrates how it works. While it is obviously artificial and not suitable for commercial solutions, it prepares you for understanding the second example.


Comments
0
Add comment