-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I'm facing some problems with templating composition when I include the template zul as the main component in a hierarchy.
I've made a fiddle to show this problem. You can see the intended design (pressing "To Template" button) and the rendered result when including the template (pressing "To Included Template").
Do you think this is a bug in zk or did I miss something?
<zk>
<include src="main.zul" />
</zk>
<?init class="org.zkoss.zk.ui.util.Composition" arg0="template.zul" ?>
<zk>
<include self="@{define(left)}" src="left.zul" />
<include self="@{define(right)}" src="right.zul" />
</zk>
<zk>
<borderlayout>
<center self="@{insert(left)}" style="background: #863" />
<east width="50%" self="@{insert(right)}" style="background: #368" />
</borderlayout>
</zk>
<zk>
<box width="100%" height="100%" pack="center" align="center">
<label value="RIGHT" />
<button onClick='Executions.sendRedirect("index.zul")' label="Back" />
</box>
</zk>
<zk>
<box width="100%" height="100%" pack="center" align="center">
<label value="LEFT" />
<button onClick='Executions.sendRedirect("index.zul")' label="Back" />
</box>
</zk>
<zk>
<button onClick='Executions.sendRedirect("main.zul")' label="To template" />
<button onClick='Executions.sendRedirect("include.zul")' label="To included template" />
</zk>
If I replace
<include src="main.zul" ></include>
with
<include src="main.zul" mode="defer" ></include>
the layout is created fine, but I have the disadventages of the the defer mode.
Is there any way to use an instant include and make the composition work?
Asked: 2012-09-06 07:43:14 +0800
Seen: 115 times
Last updated: Sep 06 '12