access implicit object

From Documentation
Revision as of 04:07, 15 July 2010 by Maya001122 (talk | contribs) (Created page with '{{ZKDevelopersGuidePageHeader}} In <tt>zscript</tt>, you can access implicit object like they are declared global variable. <source lang="xml" > <window> <zscript> self.tit…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
access implicit object


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


In zscript, you can access implicit object like they are declared global variable.

<window>
	<zscript>
		self.title="given by zscript";
	</zscript>	
</window>

the result shows window's title becomes given by zscript

Not every implicit object has its own mapping java object. But there is always a workaround. If you want to access attribute in desktopScope, the following two statements are equivalent, assuming comp is a component.

comp.getAttribute("some", comp.DESKTOP_SCOPE);
comp.getDesktop().getAttribute("some");

Desktop.java has api such as getExecution, getPage, getSession, getWebApp. And AbstractComponent.java has getSpaceOwner, getDesktop. And Execution has getArg. And ForEachImpl.java has getEach

For example, you can get the implicit object execution from any component

comp.getDesktop().getExecution()



Last Update : 2010/07/15

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.