0

Deferring popup Window using fulfill="onOpen"

asked 2008-06-16 22:57:22 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2008-06-17 00:04:06 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


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





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: 2008-06-16 22:57:22 +0800

Seen: 330 times

Last updated: Jun 17 '08

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