Notify another page

asked 2019-11-04 06:36:51 +0800

AndreyK gravatar image AndreyK
153 2

updated 2019-11-04 06:38:17 +0800

Hello everyone! I have a big question. Does ZK have any way to notify another .zul page (opened in a new browser tab) to call a method? Globalcommand doesnt work in right direction, I can only call method on "main" page from a page, opened in a new browser tab. I need notify all these pages (user, that working with reports) that session expires. Timer works on a main page. Currently i see only solution create new timer per page and restart main timer.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-11-04 10:00:11 +0800

cor3000 gravatar image cor3000
4887 2 7
ZK Team

Sounds like a scenario for a Session scoped event queue: https://www.zkoss.org/wiki/ZKDeveloper%27sReference/EventHandling/EventQueues

link publish delete flag offensive edit


Yes, but doesnt work. Even Application scoped doesnt work

AndreyK ( 2019-11-04 17:25:24 +0800 )edit

that's not very precise, since "for me" it works ... can you provide a broken example or at least some error messages you are getting?

cor3000 ( 2019-11-04 19:20:38 +0800 )edit

create main app and use Executions.getCurrent().sendRedirect("page.zul", "_blank"); Can u postGlobalCommand from main to catch it on page.zul VM? And what about multiple page.zul

AndreyK ( 2019-11-04 19:40:30 +0800 )edit

postGlobalCommand only fires a command within a single desktop (browser tab). To communicate between multiple desktops you need to use event queues, or communicate at client side via JS using postMessage (not part of ZK) https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage

cor3000 ( 2019-11-05 11:03:38 +0800 )edit

since this topic sounds more specific to your case you might consider contacting dedicated ZK support (https://www.zkoss.org/support/) especially if you can't share reproducing code in public

cor3000 ( 2019-11-05 11:05:01 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

1 follower



Asked: 2019-11-04 06:36:51 +0800

Seen: 15 times

Last updated: Nov 04

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More