0

self.getSpaceOwner().getFellow() cannot find

asked 2007-12-10 12:52:49 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4667503

By: mrabc

Hello,
I meet a problem when I want to re-do a method.
This is my simple code. The method load() is what I want to do.
It access the image's width in window "wnd".

It's correct when I use the button "click One".

But, in button "click Two" I dynamic create the window "wnd2" and button "click Three".
And add an eventListener to do the method load(), the window "wnd" can't be found by

self.getSpaceOwner().getFellow("wnd")

What should I do to make it correct?
Thanks for your reading and answer.

Richmond Wen

<zk>
<window id="wnd" border="normal">
<image id="img" src="tmp.JPG" width="100px"/> </window>

<button label="click One">
<attribute name="onClick"> {
load();
} </attribute>
</button>

<button label="click Two">
<attribute name="onClick"> {
Window wnd2 = new Window("window2", "normal", true);
wnd2.setParent(wnd);
Button btn = new Button("click Three");
btn.setParent(wnd2);
btn.addEventListener("onClick", new delEvent()); } </attribute> </button>

<zscript>
void load() {
self.getSpaceOwner().getFellow("wnd").getFellow("img").width = "300px"; }

class delEvent implements org.zkoss.zk.ui.event.EventListener {
public void onEvent(Event event) throws UiException {
load();
}
public boolean isAsap() {
return true;
}
}

</zscript>
</zk>


delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2007-12-11 02:10:06 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4669158

By: jebberwocky

When load() is called from Button3, the self.getSpaceOwner() returns wnd2 not wnd. wnd is "outside" of wnd2's Id space, therefore wnd is not found. You might want to take a look at Developer guide "The Id Space"

link publish delete flag offensive edit

answered 2007-12-11 08:42:25 +0800

admin gravatar image admin
18691 1 10 129
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4669428

By: mrabc

Okay, Thanks.

link publish delete flag offensive edit

answered 2012-07-25 02:15:54 +0800

rdcuser gravatar image rdcuser
6

Question: the self.getSpaceOwner() returns wnd2 not wnd. wnd is "outside" of wnd2's Id space,

How to find wnd ? in this example ? Thanks

link publish delete flag offensive edit

answered 2012-07-25 15:21:12 +0800

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

updated 2012-07-25 15:21:30 +0800

This is a 5 years !!!!! old thread.

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: 2007-12-10 12:52:49 +0800

Seen: 183 times

Last updated: Jul 25 '12

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