First time here? Check out the FAQ!
<window id="a1" use="testUse">
<zscript>
public void go()
{
testUse xx = new testUse();
b1.value=xx.go();
}
</zscript>
<textbox id="b1" value="aaaaa"/>
<button label="ok" onClick="go()"/>
</window>
-----------------------
--testUse.java
----------------------
public class testUse()
{
public String go()
{
return "hello";
}
}
---error! why? how to do?
First of all, your class name ends with wrong symbols "()".
Second, you may want to read more about the "use" attribute: http://books.zkoss.org/wiki/ZK_Developer's_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/ZK_Attributes
In your case you must extend your java class to org.zkoss.zul.Window. Thus, your class would be changed to
public class testUse extends org.zkoss.zul.Window { ... }
You may want to read about the "apply" attribute too.
Thank you,
Gyo
Asked: 2011-10-30 00:16:18 +0800
Seen: 159 times
Last updated: Oct 30 '11