My system is currently using Tabbed-mode add-on and I want to prevent multiple instances of the same screen to be opened at the same time. I came across the @MultipleOpen annotation on the Jmix Documentation which is said to be false by default but I still can open multiple screens simultaneosly.
Have tried to set @MultipleOpen(value = false) as well but it didnt work as intended. After that I tried setting it in the application.properties file using jmix.tabmod.multiple-open=false but it did not work too.
Could you advise me on how to properly utilize this attribute to prevent multiple instances of the same screen opening?
P.S. The jmix.tabmod.multiple-open is false by default, but the annotation @MultipleOpen is true by default so its a little confusing too whether is it true/false by default.
The @MultipleOpen annotation works as intended. As doc says:
When the @MultipleOpen annotation is present, no checks are performed and a new instance of the screen is simply opened in a new tab.
This means, that @MultipleOpen takes precedence over jmix.tabmod.multiple-open, and only its presence is checked. See io.jmix.tabbedmode.Views#isMultipleOpen.
Also, pay attention and the multiple open setting is only applied when a view is opened from the main menu, except when it is opened from a bean method. Check io.jmix.tabbedmode.builder.ViewOpeningContext#isCheckMultipleOpen usage.
Currently this is how my custom function opens my screens from my menu, multiple instances of the screen opening is still allowed after using @MultipleOpen(false), could you help to identify whether there is a flaw in the code which interferes with how @MultipleOpen performs?
P.S. screenId here refers to the value in my @ViewController annotation
When the @MultipleOpen annotation is present, no checks are performed and a new instance of the screen is simply opened in a new tab.
This means, that @MultipleOpen takes precedence over jmix.tabmod.multiple-open, and only its presence is checked, i.e. passing false to the annotation makes no sense. See io.jmix.tabbedmode.Views#isMultipleOpen.
Also, pay attention and the multiple open setting is only applied when a view is opened from the main menu, except when it is opened from a bean method. Check io.jmix.tabbedmode.builder.ViewOpeningContext#isCheckMultipleOpen usage.