Processing...

Suggested case list:

Using timer to refresh a grid

383guest172.69.33.12125nk0uiMay 7, 2020 7:23:47 AMlink

user model to move item to another listbox

120guest162.158.193.148d0n3krApr 2, 2020 5:28:28 AMlink

Disabled list item row passed to VM-1981

296fatih123160.83.36.13025nk0uiFeb 13, 2018 4:25:44 PMlink

Disabled list item row passed to VM-1981

295fatih123160.83.36.13025nk0uiFeb 13, 2018 4:25:16 PMlink

Disabled list item row passed to VM-1981

294fatih123160.83.36.13225nk0uiFeb 13, 2018 3:30:44 PMlink

grid sample with ListModel/RowRenderer

816guest80.82.2.1312vah9ajFeb 21, 2017 11:42:21 AMlink

grid sample with ListModel/RowRenderer

809guest175.98.113.1622vah9ajJan 26, 2017 9:19:33 AMlink

grid sample with ListModel/RowRenderer

196guest79.185.142.402vah9ajApr 26, 2014 10:53:57 PMlink

grid sample with ListModel/RowRenderer

195guest79.185.142.402vah9ajApr 26, 2014 10:53:54 PMlink

grid sample with ListModel/RowRenderer

194guest79.185.142.402vah9ajApr 26, 2014 10:53:51 PMlink

grid sample with ListModel/RowRenderer

193guest79.185.142.402vah9ajApr 26, 2014 10:53:48 PMlink

grid sample with ListModel/RowRenderer

192guest79.185.142.402vah9ajApr 26, 2014 10:53:44 PMlink

grid sample with ListModel/RowRenderer

191guest79.185.142.402vah9ajApr 26, 2014 10:53:40 PMlink

Hierarchy table without using ZK PE/EE

1aaknai151.28.135.2131s871daJul 29, 2013 11:02:46 PMlink

grid sample with ListModel/RowRenderer

128aaknai151.28.135.2132vah9ajJul 29, 2013 7:20:00 PMlink

user model to move item to another listbox

1TonyQ114.25.109.94d0n3krApr 21, 2012 10:43:27 AMlink

Using timer to refresh a grid

1TonyQ220.133.44.3725nk0uiFeb 17, 2012 3:17:34 AMlink

Fire a event from child iframe

1TonyQ220.133.44.372eupjotFeb 3, 2012 5:04:52 AMlink

Textbox input restriction sample

1TonyQ72.21.245.2431b3nlr0Dec 20, 2011 10:09:10 AMlink

Test web core taglib in ZUL

1TonyQ198.203.175.175ofqkemDec 17, 2011 3:36:08 AMlink

Latest 10 Fiddles :

constraint binding textbox

3guest172.68.151.16220peldaDec 5, 2025 5:08:19 PMlink

Another new ZK fiddle

2guest172.68.151.16320peldaDec 5, 2025 5:07:51 PMlink

Another new ZK fiddle

1guest172.68.151.16220peldaDec 5, 2025 5:07:32 PMlink

Another new ZK fiddle

1peggypeng172.71.154.99364f4neDec 5, 2025 9:24:31 AMlink

tooltip example

2guest104.22.23.13rc1ntoDec 4, 2025 2:23:45 PMlink

Another new ZK fiddle

1guest172.69.134.2277t7602Dec 4, 2025 1:40:46 PMlink

Another new ZK fiddle

1peggypeng104.22.17.1802df6e3oDec 4, 2025 8:41:29 AMlink

onClose

1peggypeng172.68.87.248j8kd8aDec 3, 2025 4:10:26 AMlink

Another new ZK fiddle

1peggypeng172.69.134.2271rm7f4eNov 26, 2025 3:31:24 AMlink

ZK-5912-Suggestion

2rebeccalai104.22.20.1442qrmiiuNov 26, 2025 2:07:15 AMlink

grid not adding columns when binding vars add items to List

68guest162.158.178.1171prcftdSep 19, 2022 7:00:14 AMlink

resources

index.zulzul<zk> <window id="root" viewModel="@id('rootVM') @init('pkg$vn.retail.pos.viewmodel.MainViewModel')"> <borderlayout id="mainLayout"> <north size="7%"> <hlayout> <hlayout hflex="1" vflex="1"> <hlayout hflex="2" vflex="1"> </hlayout> <button label="NEW" onClick="@command('addData')" hflex="1" vflex="1" style="border-radius: 0; border: 1px solid; background:#ffffff;" /> <button label="DELETE" onClick="@command('deleteData')" hflex="1" vflex="1" style="border-radius: 0; border: 1px solid; background:#ffffff;" /> <button label="SUPPEND" onClick="" hflex="1" vflex="1" style="border-radius: 0; border: 1px solid; background:#ffffff;" /> </hlayout> <hlayout hflex="1" vflex="1"> <image src="" /> <image src="" /> <label value="" /> <image src="" /> </hlayout> </hlayout> </north> <center style="background:#e4e4e4; padding-top: 10px; padding-left: 10px; padding-right: 10px; padding-bottom: 10px"> <hlayout hflex="1" vflex="1" spacing="10px"> <vlayout hflex="1" vflex="1" style="background: transparent"> <include src="orderLineInfo.zul" id="orderLineComp" hflex="1" vflex="1" /> </vlayout> <vlayout hflex="1" vflex="1" style="background: transparent"> <include src="orderInfo.zul" id="orderComp" hflex="1" vflex="1" /> </vlayout> </hlayout> </center> </borderlayout> </window> </zk>orderLineInfo.zulzul<vlayout hflex="1" vflex="1" viewModel="@id('vm') @init('pkg$vn.retail.pos.viewmodel.LinesViewModel')"> <hlayout hflex="1" vflex="1" style="background:#ffffff; padding-top: 5px; padding-left: 5px; padding-right: 5px; padding-bottom: 5px"> <textbox placeholder="Find Barcode" hflex="3" vflex="1" style="border: none" /> <button label="Search Product" onClick="" hflex="1" vflex="1" style="border-radius: 0; border: none; background:#ffffff;" /> </hlayout> <hlayout hflex="1" vflex="11" style="background:#ffffff; padding-top: 5px; padding-left: 5px; padding-right: 5px; padding-bottom: 5px"> <grid model="@load(vm.linesModel)" hflex="1" vflex="1" style="background:#ffffff; border: none" mold="paging" pageSize="15" pagingPosition="bottom"> <columns style="background: #ffffff; border: none "> <column label="Product Name" hflex="4" align="center" style="background: #ffffff; border: none " /> <column label="Qty" hflex="1" align="center" style="background: #ffffff; border: none " /> <column label="Amount" hflex="2" align="center" style="background: #ffffff; border: none " /> </columns> <template name="model"> <row> <div align="left"> <label value="${each.productname}" /> </div> <div align="right"> <label value="${each.qty}" /> </div> <div align="right"> <label value="${each.lineamt}" /> </div> </row> </template> <foot> <footer span="6" class="footer_right" label="@load(vm.footer)" /> </foot> </grid> </hlayout> </vlayout>orderInfo.zulzul<vlayout hflex="1" vflex="1" style="background:#ffffff;" spacing="10px"> <hlayout hflex="1" vflex="1" style="padding-top: 10px; padding-left: 10px; padding-right: 10px; background: #ffffff"> <hlayout hflex="1" vflex="1" style="background: #e4e4e4"> <label value="Đậu Xuân Kiên" hflex="4" /> <image src="" /> </hlayout> </hlayout> <hlayout hflex="1" vflex="1" style="padding-left: 10px; padding-right: 10px; padding-bottom: 10px; background: #ffffff"> <hlayout hflex="1" vflex="1" style="background: #e4e4e4"> <label value="NV A, NV B" hflex="4" /> <image src="" /> </hlayout> </hlayout> <vlayout hflex="1" vflex="10" spacing="10px" style="background:#ffffff; padding-top: 10px; padding-left: 10px; padding-right: 10px; padding-bottom: 10px"> <hlayout hflex="1" vflex="1"> <grid hflex="1" vflex="1" style="background:#ffffff; border: 0.5px solid"> <columns style="background: #ffffff; border: none "> <column label="Discount" style="background: #ffffff; border: none " /> <column label="" style="background: #ffffff; border: none " /> </columns> <rows> <row> <label value="Manual Discount" /> <label value="" /> </row> <row> <label value="Coupon 500K" /> <label value="" /> </row> </rows> </grid> </hlayout> <vlayout hflex="1" vflex="1" spacing="20px" style="padding-top: 40px; padding-right: 10px; padding-bottom: 10px"> <hlayout> <label value="SubTotal" hflex="4" vflex="1" style="font-size: 14px " /> <div align="right"> <label value="0" hflex="1" vflex="1" style="font-size: 14px " /> </div> </hlayout> <hlayout> <label value="Discount" hflex="4" vflex="1" style="font-size: 14px " /> <div align="right"> <label value="0" hflex="1" vflex="1" style="font-size: 14px " /> </div> </hlayout> <hlayout> <label value="Tax" hflex="4" vflex="1" style="font-size: 14px " /> <div align="right"> <label value="0" hflex="1" vflex="1" style="font-size: 14px " /> </div> </hlayout> <hlayout> <label value="Total" hflex="4" vflex="1" style="font-size: 14px " /> <div align="right"> <label value="0" hflex="1" vflex="1" style="font-size: 14px " /> </div> </hlayout> <hlayout></hlayout> </vlayout> </vlayout> <hlayout hflex="1" vflex="2" style="background:#ffffff; padding-top: 10px; padding-left: 10px; padding-right: 10px; padding-bottom: 10px"> <hlayout hflex="1" vflex="1"> <image src="zul/image/info.png" /> </hlayout> <hlayout hflex="4" vflex="1" style="background:#ffffff; border:none"> <button label="CHECK OUT" onClick="" hflex="1" vflex="1" style="border-radius: 0; border: 1px solid; background:#ffffff;" /> </hlayout> </hlayout> </vlayout>MainViewModel.javajava import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.zkoss.bind.BindUtils; import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.NotifyChange; public class MainViewModel { protected static final String footerMessage = "A Total of %d Items"; protected static List<ObjLinesItem> lines = new ArrayList<ObjLinesItem>(); static { lines.add(new ObjLinesItem(Integer.valueOf(1), "Product", BigDecimal.valueOf(1), BigDecimal.valueOf(100000))); lines.add(new ObjLinesItem(Integer.valueOf(1), "Product", BigDecimal.valueOf(1), BigDecimal.valueOf(100000))); lines.add(new ObjLinesItem(Integer.valueOf(1), "Product", BigDecimal.valueOf(1), BigDecimal.valueOf(100000))); } @Command @NotifyChange({ "linesModel", "footer" }) public void addData() { List<ObjLinesItem> currentLines = lines; currentLines.add( new ObjLinesItem(Integer.valueOf(1), "Product", BigDecimal.valueOf(1), BigDecimal.valueOf(100000))); } @Command @NotifyChange({ "linesModel", "footer" }) public void deleteData() { List<ObjLinesItem> currentLines = lines; if (currentLines.size() > 0) currentLines.remove(currentLines.size() - 1); } /* public void log(String message) { log.append("\n").append(message); BindUtils.postNotifyChange(null, null, this, "log"); System.out.print("log " + message); } public String getLog() { return log.toString(); } */ } LinesViewModel.javajavaimport java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import org.zkoss.bind.BindUtils; import org.zkoss.bind.annotation.BindingParam; import org.zkoss.bind.annotation.Init; import org.zkoss.zul.ListModel; import org.zkoss.zul.ListModelList; public class LinesViewModel extends MainViewModel { public ListModel<ObjLinesItem> getLinesModel() { return new ListModelList<ObjLinesItem>(lines); } public String getFooter() { return String.format(footerMessage, lines.size()); } public static List<ObjLinesItem> getLines() { return lines; } public static String getFooterMessage() { return footerMessage; } /* @Init public void init(@BindingParam("parent") MainViewModel parent) { this.parent = parent; parent.log("Child knows parent"); System.out.print("Child knows parent"); } public void log(String message) { log.append("\n").append(message); BindUtils.postNotifyChange(null, null, this, "log"); System.out.print("log " + message); } public String getLog() { return log.toString(); } */ }ObjLinesItem.javajavaimport java.math.BigDecimal; public class ObjLinesItem { private int line; // order line id private String productname; private BigDecimal qty; private BigDecimal lineamt; public ObjLinesItem(int line, String productname, BigDecimal qty, BigDecimal lineamt) { this.line = line; this.productname = productname; this.qty = qty; this.lineamt = lineamt; } public int getLine() { return line; } public void setLine(int line) { this.line = line; } public String getProductname() { return productname; } public void setProductname(String productname) { this.productname = productname; } public BigDecimal getQty() { return qty; } public void setQty(BigDecimal qty) { this.qty = qty; } public BigDecimal getLineamt() { return lineamt; } public void setLineamt(BigDecimal lineamt) { this.lineamt = lineamt; } }