zktest/src/main/webapp/zuti/mvvm/_if/nestedIf.zul
<zk>
<zscript>
public class MyLabel extends Label {
public void onCreate() {
setValue(getParent().toString());
}
}
</zscript>
<div id="bind" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('org.zkoss.zktest.zats.zuti.vm.ManipulateInsertionVM')">
<div id="host" apply="org.zkoss.zktest.zats.zuti.composer.ShadowComposer">
<if test="@load(vm.rootVisible)">
<if test="@load(vm.visible)">
<div style="background:yellow"><label use="MyLabel"/></div>
<if test="true">
<div style="background:yellow"><label use="MyLabel"/></div>
<if test="@load(vm.visible)">
<div style="background:yellow"><label use="MyLabel"/></div>
</if>
<div style="background:yellow"><label use="MyLabel"/></div>
<if test="true">
<if test="@load(vm.visible)">
<div style="background:yellow"><label use="MyLabel"/></div>
</if>
</if>
</if>
</if>
<if test="@load(vm.visible)">
<div style="background:yellow"><label use="MyLabel"/></div>
</if>
<div style="background:yellow;"><label use="MyLabel"/></div>
</if>
</div>
<button id="changeVisible" label="Change if visible" onClick='@command("changeVisible")'/>
</div>
<debugger rootId="host"/>
</zk>