Skip to content

Instantly share code, notes, and snippets.

@dennischen
Created December 18, 2012 06:31
Show Gist options
  • Save dennischen/4325583 to your computer and use it in GitHub Desktop.
Save dennischen/4325583 to your computer and use it in GitHub Desktop.
ziles pseudo code.
<?init class="org.zkoss.zk.ui.util.Composition" arg0="/compos-template.zul" ?>
<zk>
<window self="@define(content)" title="window1" width="100px" />
<window self="@define(content)" title="window2" width="200px" />
<div self="@define(detail)" width="300px" height="100px">
<div apply="org.zkoss.bind.BindComposer"
viewModel="@id('inner') @init('org.zkoss.ziles.web.Case0ViewModel')">
<hlayout>
<textbox value="@bind(inner.userName)" />
<label value="@bind(inner.userName)" />
</hlayout>
</div>
</div>
</zk>
<window title="template" border="normal">
<hbox>
<hbox self="@insert(content)"/>
<hbox self="@insert(detail)"/>
</hbox>
</window>
<?page title="Page0"?>
<zk>
<ziles id="layout" layout="/testcase/layout/layout1.zul" width="100%" height="100%">
<custom-attributes ziles.title="Page 0 on Title" ziles.footer="Page 0 on Footer"/>
<template name="ziles.header" src="/testcase/layout/header.zul"/>
<template name="ziles.footer" src="/testcase/layout/footer.zul"/>
<template name="ziles.body">
<div>
This is page 0
</div>
</template>
</ziles>
</zk>
<zk>
<ziles layout="/testcase/layout/layout1-defval.zul" width="100%" height="100%">
<custom-attributes ziles.title="Page 1 on Title"/>
<template name="ziles.body">
<div>
This is page 1
</div>
</template>
</ziles>
</zk>
<zk>
<!--layout with default value -->
<ziles layout="/testcase/layout/layout1.zul">
<custom-attributes ziles.title="Zk Application Title" ziles.footer="Zk Application Footer" />
<template name="ziles.header" src="/testcase/layout/header.zul"/>
<template name="ziles.footer" src="/testcase/layout/footer.zul"/>
</ziles>
</zk>
<zk>
<vlayout width="400px">
<div id="header" ziles="@replace()">
Header here
</div>
<window id="body" ziles="@replace() @target(div)">
<hbox>
<div >
Body here
</div>
</hbox>
</window>
<div id="footer" ziles="@replace()">
Footer here
</div>
</vlayout>
</zk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment