Skip to content

Add note and code example of disabling server modality #4404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions articles/components/dialog/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a new section (e.g., === Disabling Modality) instead of an admonition? What are those cases, could we offer an example? And why do I have to do it after the 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

Expand Down
Loading