Load ZUML in Java

From Documentation
Revision as of 07:31, 9 November 2010 by Tomyeh (talk | contribs)



Execution provides a collection of methods to allow you to create components based a ZUML document, such as Execution.createComponents(String, Component, Map), Execution.createComponentsDirectly(String, String, Component, Map) and many others. In additions, Executions provides a similar collection of shortcuts, so that you don't have to retrieve the current execution first.

For example,

public class Controller extends GenericForwardComposer {
    private Window main; //assumed wired automatically
    public void onClick() {
        Executions.createComponentsDirectly(
           "<listbox><listitem label=\"foo\"/></listbox>", "zul", this, null);
    }
...

Create Components from an URI

There are several ways to create components based a ZUML document. One of the most common approach is to create components from a URI.

Map arg = new HashMap();
arg.put("some.param", someValue);
Executions.createComponents("/foo/my.zul", parent, arg);

where parent (an instance of Component) will become the parent of the components specified in the ZUML document. If parent is null, the components specified in the ZUML documents will become the root components of the current page.

Version History

Last Update : 2010/11/9

Version Date Content
     



Last Update : 2010/11/09

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