A variant of the interface without using modal windows

1C: Enterprise uses modal home windows in conditions when the person is required to enter data, without which another algorithm execution is unimaginable. In this case, the entire remainder of this system interface is blocked, and the execution of this system code stops till the person closes the modal window.

With the arrival of the net consumer and with the transition of 1C: Enterprise to cell platforms, modal home windows turned out to be a supply of many inconveniences and issues, typically insoluble.

As a rule, “desktop” browsers are higher or worse; however, they help modals and open them in a brand new browser window as a “popup”:

However, because popup expertise is extensively used on the Web for promoting, popups are disabled by default in virtually all browsers. Within the overwhelming majority of circumstances, without altering this browser setting, the operation of the net consumer turns unimaginable.

One other downside is that cell browsers do not help modals in any respect. And so that 1C: Enterprise may work in them, a particular mechanism was carried out within the internet consumer. It is a slightly complicated mechanism and, sadly, it doesn’t cowl all the required conditions. Consequently, configurations on an iPad, for instance, are tough to work with.

In such a state of affairs, the choice of the 1C: Enterprise interface without utilizing modal home windows removes all the issues listed above.

This doesn’t abandon the performance beforehand supplied by modal home windows. However, this performance is carried out by different applied sciences that don’t intrude with the operation of 1C: Enterprise in browsers.

Within the new mode of operation of the interface, the window, which might have been modal earlier than, is drawn throughout the guardian window, and in the identical method blocks the remainder of the interface of the net consumer:

In consequence:

  • no new browser home windows are opened, which improves the efficiency and stability of the net consumer;
  • in lots of circumstances, further browser settings grow to be pointless, since 1C: Enterprise now does not makes use of popup home windows;
  • any configuration utilizing the net consumer can work on iPad and different cell units.

Naturally, miracles don’t occur, and the brand new working mode can’t be switched on with a “wave of a magic wand”. It’s required to alter the logic of working with new blocking home windows. However, the excellent news is that these modifications will not be tough, and it’s attainable to manage all of the “suspicious” elements of this system. The platform implements a particular mechanism that permits the growth stage to verify that your entire configuration uses new instruments and can work without modal home windows.

The necessity to change the logic of working with such home windows is because the brand new interface operation mode gives modality just for the person. Nonetheless, for the developer, in the intervening time, the blocking window is displayed, the execution of this system code doesn’t cease.

Because of this, the algorithm, which was once complete, now needs to be divided into two elements. One ends with the opening of a blocking window, and the second can be executed when the person closes this window. To ensure that the system knows where to proceed to implement this system code, the title of the process that has to be executed when the person closes this window is handed to the blocking window.

The essence of those modifications is best to see with an instance. An outdated process that opened a modal window and processed the info it obtained may appear like this:

Within the new model, for the FormTextInput kind (which can open in a blocking window), you should set the WindowOpeningMode property to LockAllInterface. This can present modality to the person:

And this system code as a substitute of 1 process, as earlier than, will already comprise two procedures:

Within the first process, we open the shape. In this case, within the final parameter, we cross the placement of the second process, which can be executed after the person closes the window. In this case, this process is situated in the identical module; however, on the whole, it may be situated in one other.

When the person enters information and closes the shape, they will be processed within the second process we specified, into which we merely transferred the “outdated” code that processes the obtained information.

Along with varieties {that a} developer can open in modal mode (at will), there are embedded language strategies that at all times, whatever the developer’s want, open modal varieties for getting into or deciding on the information. For instance, the EnterValue () methodology.

It’s even simpler to make use of such strategies in non-modal mode. For all such strategies, the platform has made duplicate strategies. When calling them, you additionally want to point out the placement of the process that can be executed after the person closes the window.

For instance, the next reveals the usage of the outdated EnterValue () methodology and its new counterpart ShowInputValue ():

I have to say that, along with the listed circumstances, some platform mechanisms additionally use modal home windows to work together with the person. And this doesn’t rely on any method of the developer’s actions.

Subsequently, all such system dialogues of the platform are additionally transferred to a non-modal model of the work.

It’s deliberate to progressively abandon the usage of modal home windows in utilized options. Subsequently, for compatibility with utilized options written earlier, the platform retains the power to work within the outdated model of the interface, utilizing modal home windows.


Related Articles

Latest Articles