-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
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.
Asked: 2010-04-18 15:56:09 +0800
Seen: 513 times
Last updated: Apr 19 '10