# Call a java function included in another zul file

afxgroup
126 1

Hello,
I have this problem. I want to create a global zul file that contains a function that is used in many other zul files. For example:

		<![CDATA[
desktop.getPage("index").setAttribute("navigatorindex", "");
Include inc = (Include) Path.getComponent("//index/navigator/");
inc.setSrc(sUrl);
inc.invalidate();
}
]]>


then, i want to include it with <include src="/mypage.zul" /> in any file that should use it. But the function is not found by the pages. Is this possible or i must create a class in a package and then use it?

Thank you

delete retag edit

## 2 Replies

woodyki
168

You can put all functions into a .zs then use the tag <zscript src="/myscript.zs" />

afxgroup
126 1

Sorry, but i don't see any "src" property in <zscript> tag..

EDIT
It is possible i have an old version of zk installed..

[hide preview]