-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5036804
By: dinglemouse
Hi,
I have a window component I have implemented with my own class extending the ZK Window
I use this window as a popup. eg I call win.doPopup() to may it visible.
All is well.
--
But my window has lots of components so I now wish to use the load-on-demand attribute to defer loading until doPopup is actually called. Something like
this:
<window id="win" use="com.xxx.MyWin" fulfill="onOpen">
But onOpen event is not being called.
I read the Javadoc API for Window which says "Note: to have better performance, onOpen is sent only if a non-deferrable event listener is registered (see Deferrable)."
So I am not sure what I should do. Do I need some dummy (non-deferrable) listener just to make the onOpen event fire?? I just need a simple example how to detect some event when Window.doPopup occurs.
Thanks,
DM
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5036877
By: dinglemouse
I have come up with a different strategy to avoid onOpen:
Instead of load-on-demand when onOpen occurs (fulfill="onOpen") I am using fufill="onPopup", where "onPopup" is a new event handler of my own
My onPopup handler implementation simply does this.doPopup() for the window, plus the other code I wanted to defer.
And instead of win.doPopup(), the callers popping up this window are simply doing Events.sendEvent(new Event("onPopup", win));
Now it's all working and my components are getting deferred like I wanted.
Please advise if this strategy was a dumb way to do it...
Thanks,
DM
Asked: 2008-06-16 22:57:22 +0800
Seen: 331 times
Last updated: Jun 17 '08