0

zk5.0.6 javascript and java

asked 2011-02-23 01:56:58 +0800

yuzexu_zk gravatar image yuzexu_zk
240 2

test.zul
<window apply="com.TestController">
<script type="text/javascript" defer="false">
<![CDATA[
var comm = {
test:function(id)
{
//alert(host.info);
var msgWidget = zk.Widget.$(id);

msgWidget.setValue("123");
}
};
<textbox id="test"/>
<button label="click" onClick="alert(test.value)"/>
</window>
TestController.java

public class TestController extends GenericForwardComposer
{
private Textbox test;

public void doAfterCompose(Component comp) throws Exception
{
super.doAfterCompose(comp);
Clients.evalJavaScript("comm.test(\"" + test.getUuid() + "\");");
}
}

the js is set textbox value but when i click the button alert msg is ""
how i to get the textbox value

delete flag offensive retag edit
Be the first one to reply this discussion!
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: 2011-02-23 01:56:58 +0800

Seen: 168 times

Last updated: Feb 23 '11

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