From 491084e3d220cc032a0c72728dae207c31f4f0ef Mon Sep 17 00:00:00 2001 From: Tatu Lund Date: Fri, 27 Jun 2025 09:38:56 +0300 Subject: [PATCH] Add note and code example of disabling server modality --- articles/components/dialog/index.adoc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/articles/components/dialog/index.adoc b/articles/components/dialog/index.adoc index 4ce0f05bf8..b1947e5e7d 100644 --- a/articles/components/dialog/index.adoc +++ b/articles/components/dialog/index.adoc @@ -199,6 +199,21 @@ endif::[] Usually, non-modal dialogs should be draggable, so that the user can move them to access the user interface beneath. +[NOTE] +In some use cases you may want to disable the server side modality. This can be done after Dialog has been opened. + +[source,java] +---- + Dialog dialog = new Dialog(); + dialog.addOpenedChangeListener(e -> { + if (e.isOpened()) { + UI.getCurrent().setChildComponentModal(dialog, false); + } + }); + // Dialog needs to be added to layout + add(dialog); +---- + == Position