0

Call Zscript from java composer

asked 2012-02-10 23:20:41 +0800

satan87 gravatar image satan87
255

Hello again ;)

i got an issue when i try to call a Zscript function from my java composer

see.zul

<?component name="top" inline="true" macro-uri="top.zul" ?>
<?component name="menu" inline="true" macro-uri="menu.zul" ?>
<?component name="menusee" inline="true" macro-uri="menuSee.zul" ?>

<window id="wintoday" onCreate="initStatus()" apply="com.nsa.n74.tvshowtrackerewb.zk.window.windowSeeToday" >
<top />
${labels.welcome} <label id="user"></label> 
<menu />

<div>
<menusee />
</div>

<div>
	Days Before Today : <intbox id="txt1" value="2" />
	Days After Today : <intbox id="txt2" value="1" />
	<button id="btnrefresh"  label="Refresh" onClick="seeToday(txt1.getValue() , txt2.getValue() )" />
	Res : <label id="lblres" />
</div>


<zscript><![CDATA[
public void test()
{
	try
	{
		Messagebox.show("in zscript");
	}catch(Exception e){}
}

]]></zscript>
</window>

mycomposer

public class windowSeeToday extends GenericForwardComposer 
{
	private Window wintoday;
	private Intbox txt1;
	private Intbox txt2;

	public void onOK$txt1(){
		st();
	}
	public void onOK$txt2(){
		st();
	}
	public void st(){
		
		wintoday.getPage().getZScriptFunction("test()",null);

	}
}

nothing happened !, and when i tried to retrieve the function, with

Function fn= wintoday.getPage().getZScriptFunction("test()",null);
fn is null

Any idea ?

thanks
nicolas

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-02-14 08:22:24 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

You have to put the component scope for the zscript function.
For example,

wintoday.getPage().getZScriptFunction(wintoday, "test",null)

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: 2012-02-10 23:20:41 +0800

Seen: 107 times

Last updated: Feb 14 '12

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