-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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
You have to put the component scope for the zscript function.
For example,
wintoday.getPage().getZScriptFunction(wintoday, "test",null)
Asked: 2012-02-10 23:20:41 +0800
Seen: 107 times
Last updated: Feb 14 '12