Define Macro Component
任意的ZUML page 都可以作为一个macro component
我们在web-inf下新建macro,并新建一个username.zul
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<hlayout>
username: <textbox/>
</hlayout>
</zk>
declare and use macro component
<?component name="username" macroURI="/WEB-INF/macro/username.zul"?>
<zk>
<window title="new page title" border="normal">
<username/>
</window>
</zk>
我们可以为macro指定属性
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<hlayout>
${arg.label }:<textbox value="${arg.who }"/>
</hlayout>
</zk>
在使用的时候,可以这样,当然也可以直接在username上指定属性的起始值
<?component name="username" macroURI="/WEB-INF/macro/username.zul" label="username" who="john"?>
<zk>
<window title="new page title" border="normal">
<username/>
</window>
</zk>