Skip to content
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

Allow UI polling even when a modal dialog is open #20917

Open
Legioth opened this issue Jan 27, 2025 · 2 comments
Open

Allow UI polling even when a modal dialog is open #20917

Legioth opened this issue Jan 27, 2025 · 2 comments

Comments

@Legioth
Copy link
Member

Legioth commented Jan 27, 2025

Describe your motivation

UI polling (i.e. ui.addPollListener) is a "global" feature that isn't tied to any specific component. It should therefore not be considered to be "behind" a modality curtain.

Right now, you get an Ignored listener invocation for ui-poll event from the client side for an inert body element error with polling when a modal dialog is open.

Describe the solution you'd like

Make the framework register poll listeners with DomListenerRegistration::allowInert so that the listener keeps working regardless of modal dialogs.

Describe alternatives you've considered

An alternative would be to provide an overload of addPollListener that would let the developer choose whether to allow polls while a modal dialog is open. I don't think that's necessary since UI-level polling is anyways "global" and doesn't pass any user-controlled data to the server.

Additional context

Recent forum discussions:

@Legioth
Copy link
Member Author

Legioth commented Jan 27, 2025

As a workaround, instead of registering the poll listener in the regular way, you can instead register it like this:

ComponentUtil.addListener(ui, PollEvent.class, event -> {
    System.out.println("Poll event: " + event);
}, DomListenerRegistration::allowInert);

@raghuG005
Copy link

I have implemented a workaround and it is working .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔖 Normal Priority (P2)
Status: 🅿️Parking lot
Development

No branches or pull requests

3 participants