Skip to content

Instantly share code, notes, and snippets.

View dennischen's full-sized avatar

Dennis Chen dennischen

View GitHub Profile
<div form="@id('fx') @load(vm.product) @save(vm.product,before='save')">
<vlayout item="@ref(fx.item)" name2="@ref(fx.item.name2)">
<div>
item.name1:
<textbox value="@bind(item.name1)"/>(value is saved to item directly)
</div>
<div>
name2:
<textbox value="@bind(name2)"/>(value is not updated after save)
</div>
<zk>
<label multiline="true">
1.you should see there are 10 page and currently at page 4.
2.change the page, the label should change to corresponding page also.
</label>
<vlayout apply="org.zkoss.bind.BindComposer"
viewModel="@id('searchvm') @init('org.zkoss.zktest.bind.issue.B01908DatabindingOnPaging')">
<paging pageSize="@load(searchvm.pageSize)" id="pg"
totalSize="@load(searchvm.totalSize)"
activePage="@bind(searchvm.activePage)"
<zk>
<window id="w3" apply="org.zkoss.bind.BindComposer" title="use item in selItem (vm.selItem2.subItem)" border="normal" width="350px"
viewModel="@id('vm') @init('org.zkoss.zktest.bind.issue.B01899ComboboxReloadSelectedItem')"
validationMessages = "@id('vmsgs')">
<combobox id="cb" model="@load(vm.items)"
selectedItem="@bind(vm.selItem2.subItem)@validator(vm.validator)">
<template name="model">
<comboitem label="@load(each.name)"/>
</template>
</combobox>
<window border="none" width="100%" height="100%" id="test">
<zscript><![CDATA[
void setModel(){
ListModelList model = new ListModelList();
for(int i=0;i<100;i++){
model.add("A"+i);
}
listbox.setModel(model);
}
]]></zscript>
<zk>
<label multiline="true">
1.Select combobox 01,
2.in combobox , delete 1, and tab out, you will see error message
3.in combobox, delete 0, the combobox should stay on empty (it becomes 01 if bug wasn't fixed)
</label>
<window apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('org.zkoss.zktest.bind.issue.B01891ComboboxValidator')"
validationMessages = "@id('vmsgs')">
<zk>
<style>
.icon{
width: 40px; background-color: red; height: 20px;
border:1px solid blue;
margin-top:2px;
}
</style>
<label multiline="true">
1. click on a un-selected item's inner div.
<zk>
<window apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('org.zkoss.zktest.bind.issue.B01848FormBindingUpdate')">
<div form="@id('fx')@load(vm.product)">
<vlayout>
<div>
fx.item: <label value="@load(fx.item)"/><!--
fx.item: <label value="@load(fx['item'])"/>-->
</div>
<div>
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<grid apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('org.zkoss.zktest.bind.issue.B01795NestedTemplate')"
model="@load(vm.profiles)">
<template name="model" var="profile">
<row children="@load(vm.columns)">
<template name="children" var="column">
<label value="@load(vm.getProfileSkillsX(column,profile))"/>
<label value="@load(vm.getProfileSkills(profile,column))"/>
<zk>
<window apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('org.zkoss.zktest.bind.issue.B01787NotifyChangeCase')">
<label multiline="true"><![CDATA[
[Analysis]
1.when <vm>.path change. it also notify it's kidbase, which is <path-instance>.*
2.pnode is tracking as <path-instance>[index], which match <path-instance>.*, so it will be notify change.
3.according 1, <pnode-instance>.* will be notified.
4.cnode is the same instnace as pnode, so. cnode.name will also be reload.
========================
@dennischen
dennischen / compos-main.zul.xml
Created December 18, 2012 06:31
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)" />