0

calling zscript from subwindow

asked 2006-04-21 09:18:37 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: nobody

When I press the first button, it executes fine, but the second button doesn't.
How to fix this problem? Thank you


<?taglib uri="/WEB-INF/tld/zul/core.dsp.tld" prefix="u" ?> <html xmlns:x="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:zk="http://www.potix.com/2005/zk">
<head>
<title>ZHTML Demo</title>
</head>
<body>


<x:window id="main" title="HTML App">
<zk:zscript>
import com.potix.zul.html.*;
void CreateNewWindow() { //running at the server
Window win = new Window();
win.setTitle("allala");
win.setWidth("200px");
win.setHeight("150px");
win.setClosable(true);
win.setBorder("normal");
win.setParent(main);
win.doOverlapped();
}
</zk:zscript>
<x:button label="Button 1" zk:onClick="CreateNewWindow()"/>

<x:window id="sub" title="sub">
<x:button label="Button 2" zk:onClick="CreateNewWindow()"/>
</x:window>
</x:window>

</body>
</html>


delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2006-04-21 09:33:57 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: henrichen

Try the latest nightly. It was fixed.

/henri

link publish delete flag offensive edit

answered 2006-04-21 09:44:18 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: henrichen

The old spec limit the zscript's scope at the IdSpace (to avoid method and variable name pollution). The new spec would traverse upward along the IdSpace to find the method or variable with the name.

In your example, the "subwindow" is another IdSpace and I guess you are using some older version :)( Sorry, I cannot remember when this spec. is changed).
I have tried your example on my local server and it works without problem.

/henri


link publish delete flag offensive edit

answered 2006-04-21 10:08:28 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: nobody

Thank you for your immediate response. I tried latest nightly and it works now.

link publish delete flag offensive edit

answered 2006-04-21 10:22:21 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: henrichen

Gald to know the problem solved.

/henri

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: 2006-04-21 09:18:37 +0800

Seen: 289 times

Last updated: Apr 21 '06

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