0

Bandbox.setOpen in ZK5?

asked 2010-08-19 04:06:37 +0800

mw88 gravatar image mw88
93 2
http://www.mw88.org

Hello,

I need to open a Bandbox by default but if it doesn't work with this code (Java):

Bandbox bbTestbox = new Bandbox();
bbTestbox.setOpen(true);
bbTestbox.setParent(window);

What would be the correct approach to do that?

Thanks in advance

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-08-20 10:54:41 +0800

twiegand gravatar image twiegand
1807 3

updated 2010-08-20 10:55:21 +0800

mw88,

I suspect the reason it doesn't open is because you haven't defined any children. To test the theory, change your first line to something like:

Bandbox bbTestbox = new Bandbox("xxx");

You should see the drop-down shown when you first bring up the page.

Also, if you decide to build your bandbox in ZUL, you can make the bandbox open automatically by doing the following:

<bandbox id="bd" mold="rounded" onCreate="self.setOpen(true)">

Hope that helps.

Todd

link publish delete flag offensive edit

answered 2010-08-20 14:17:51 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Hmmmm, interesting. I played a little bit for the needed case without success. I have tried the way with a manually sended onOpen event.
Seems like the documentation said, the onOpen event is called AFTER the user clicks manually on it.

Supported events

Name         Event Type
onOpen     Event: OpenEvent
                  Denotes user has opened or closed a component. Note: unlike onClose, this event is only a notification. The client sends this event after opening or closing the component.

best
Stephan

link publish delete flag offensive edit

answered 2010-08-23 04:00:10 +0800

mw88 gravatar image mw88
93 2
http://www.mw88.org

Thank you both for your answers.

I noticed that I had to initialize my Window in Order to get this working.
After initializing I placed the command bbTestbox.setOpen(true).
Now its working ;-)

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-08-19 04:06:37 +0800

Seen: 315 times

Last updated: Aug 23 '10

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