0

Reuse Desktop and ClientInfoEvent

asked 2010-04-18 15:56:09 +0800

ecarpenter gravatar image ecarpenter
33 5

The Problem
I have implemented the new Reuse Desktop feature of ZK5 but is having problems to get the ClientInfo Event to work. The ClientInfo Event seams to be "lost" when the desktop is recycled.

I have extended the DesktopRecycle class as follows:
public Desktop beforeService(Execution exec, String path)
{
final Session sess = exec.getSession();
MainDesktop mainDesktop = (MainDesktop) sess.getAttribute("mainDesktop");
if (mainDesktop != null) {
return mainDesktop.getDesktop();
}

return super.beforeService(exec, path);
}

Quick explanation of what the above does
During the first load of the URL, a new window is created of the type MainDesktop (an extension of Window) and a reference to it is stored as a session variable. If the same URL is entered on a different browser tab and the MainDesktop variable is found, the desktop associated with that window is returned.

Steps followed
1. Launch the application on first tab in FF
2. Type the same url on a second tab in FF. The ZK engine detects that the desktop exists and returns the same desktop as per tab 1.
3. Switch to first tab and resize the browser window and ClientInfoEvent fires.
4. Switch to second tab and resize browser window and no events is fired.

As far as I can see only the ClientInfo Event is effected. Everything else works as expected.

Any suggestions on how I can fix this?

Regards
Eddie

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2010-04-19 01:25:11 +0800

iantsai gravatar image iantsai
2755 1

Hi, thanks for your question, we found this is a bug in ZK, and you can follow it in:
http://sourceforge.net/tracker/?func=detail&aid=2989172&group_id=152762&atid=785191

link publish delete flag offensive edit

answered 2010-04-19 01:50:34 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

In additions to fixing the bug, I will add a notification event called onDesktopRecycle (see feature request) so you can do some application-specific handling by listening to onDesktopRecycle at a top-level component.

link publish delete flag offensive edit
Your reply
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

Follow

RSS

Stats

Asked: 2010-04-18 15:56:09 +0800

Seen: 513 times

Last updated: Apr 19 '10

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