Suggested case list:
Using timer to refresh a grid
383guest172.69.33.12125nk0uiMay 7, 2020 7:23:47 AMlinkuser model to move item to another listbox
120guest162.158.193.148d0n3krApr 2, 2020 5:28:28 AMlinkDisabled list item row passed to VM-1981
296fatih123160.83.36.13025nk0uiFeb 13, 2018 4:25:44 PMlinkDisabled list item row passed to VM-1981
295fatih123160.83.36.13025nk0uiFeb 13, 2018 4:25:16 PMlinkDisabled list item row passed to VM-1981
294fatih123160.83.36.13225nk0uiFeb 13, 2018 3:30:44 PMlinkgrid sample with ListModel/RowRenderer
816guest80.82.2.1312vah9ajFeb 21, 2017 11:42:21 AMlinkgrid sample with ListModel/RowRenderer
809guest175.98.113.1622vah9ajJan 26, 2017 9:19:33 AMlinkgrid sample with ListModel/RowRenderer
196guest79.185.142.402vah9ajApr 26, 2014 10:53:57 PMlinkgrid sample with ListModel/RowRenderer
195guest79.185.142.402vah9ajApr 26, 2014 10:53:54 PMlinkgrid sample with ListModel/RowRenderer
194guest79.185.142.402vah9ajApr 26, 2014 10:53:51 PMlinkgrid sample with ListModel/RowRenderer
193guest79.185.142.402vah9ajApr 26, 2014 10:53:48 PMlinkgrid sample with ListModel/RowRenderer
192guest79.185.142.402vah9ajApr 26, 2014 10:53:44 PMlinkgrid sample with ListModel/RowRenderer
191guest79.185.142.402vah9ajApr 26, 2014 10:53:40 PMlinkHierarchy table without using ZK PE/EE
1aaknai151.28.135.2131s871daJul 29, 2013 11:02:46 PMlinkgrid sample with ListModel/RowRenderer
128aaknai151.28.135.2132vah9ajJul 29, 2013 7:20:00 PMlinkuser model to move item to another listbox
1TonyQ114.25.109.94d0n3krApr 21, 2012 10:43:27 AMlinkUsing timer to refresh a grid
1TonyQ220.133.44.3725nk0uiFeb 17, 2012 3:17:34 AMlinkFire a event from child iframe
1TonyQ220.133.44.372eupjotFeb 3, 2012 5:04:52 AMlinkTextbox input restriction sample
1TonyQ72.21.245.2431b3nlr0Dec 20, 2011 10:09:10 AMlinkTest web core taglib in ZUL
1TonyQ198.203.175.175ofqkemDec 17, 2011 3:36:08 AMlinkLatest 10 Fiddles :
constraint binding textbox
3guest172.68.151.16220peldaDec 5, 2025 5:08:19 PMlinkAnother new ZK fiddle
2guest172.68.151.16320peldaDec 5, 2025 5:07:51 PMlinkAnother new ZK fiddle
1guest172.68.151.16220peldaDec 5, 2025 5:07:32 PMlinkAnother new ZK fiddle
1peggypeng172.71.154.99364f4neDec 5, 2025 9:24:31 AMlinktooltip example
2guest104.22.23.13rc1ntoDec 4, 2025 2:23:45 PMlinkAnother new ZK fiddle
1guest172.69.134.2277t7602Dec 4, 2025 1:40:46 PMlinkAnother new ZK fiddle
1peggypeng104.22.17.1802df6e3oDec 4, 2025 8:41:29 AMlinkonClose
1peggypeng172.68.87.248j8kd8aDec 3, 2025 4:10:26 AMlinkAnother new ZK fiddle
1peggypeng172.69.134.2271rm7f4eNov 26, 2025 3:31:24 AMlinkZK-5912-Suggestion
2rebeccalai104.22.20.1442qrmiiuNov 26, 2025 2:07:15 AMlinkborderlayout with tabs problem
5guest109.69.133.66n4phl1Jun 14, 2018 12:10:23 PMlinkresources
index.zulzul<?xml version="1.0" encoding="UTF-8"?>
<?page title="RAD4" contentType="text/html;charset=UTF-8" id="mainframe" docType="html" ?>
<?link rel="icon" type="image/x-icon" href="/img/favicon.ico"?>
<?link rel="shortcut icon" type="image/x-icon" href="/img/favicon.ico"?>
<zk xmlns="http://www.zkoss.org/2005/zul" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">
<window id="root" border="normal" vflex="1" hflex="1" sclass="T_root" >
<borderlayout>
<center id="center" border="normal" autoscroll="true" sclass="T_center" vflex="min">
<include id="content" src="welcome.zul" mode="instant" sclass="T_content" vflex="min"/>
</center>
<west collapsible="true" splittable="true">
<include src="sidebar.zul" />
</west>
</borderlayout>
</window>
</zk>
sidebar.zulzul<?xml version="1.0" encoding="UTF-8"?>
<?page title="Task@Org" contentType="text/html;charset=UTF-8" id="mainframe" docType="html" ?>
<div vflex="1">
<style>.z-toolbar {
background-image:linear-gradient(#92DEE8, #92C7E8);
}
.z-toolbarbutton-content {
text-shadow :none;
}</style>
<toolbar orient="vertical" vflex="1" style="">
<toolbarbutton label="Personal tasks"/>
<toolbarbutton label="Cell tasks"/>
<toolbarbutton label="Search tasks" />
</toolbar>
</div>task.zulzul<div>
<tabbox orient="left">
<tabs width="100px">
<tab label="General info" />
<tab label="Task info" />
<tab label="Recipients" />
<tab label="Proposition" />
<tab label="Comments" />
<tab label="Attachments" />
<tab label="Solution" />
<tab label="History" />
</tabs>
<tabpanels>
<tabpanel vflex="1">
<grid>
<columns>
<column hflex="min" align="right" />
<column hflex="1" />
</columns>
<rows>
<row>
<label value="Title" />
<textbox value="title" width="80%" />
</row>
<row>
<label value="Context" />
<textbox value="context" rows="30" width="80%" />
</row>
</rows>
</grid>
</tabpanel>
<tabpanel vflex="1">
<grid>
<columns>
<column hflex="min" align="right" />
<column hflex="1" />
</columns>
<rows>
<row>
<label value="Title" />
<textbox value="title" width="80%" />
</row>
<row>
<label value="Description" width="80%" />
<textbox value="description" rows="30" width="80%" />
</row>
<row>
<label value="Creation date" />
<datebox />
</row>
<row>
<label value="Planning date" />
<datebox />
</row>
<row>
<label value="Due date" />
<datebox />
</row>
<row>
<label value="restricted" />
<checkbox />
</row>
<row>
<label value="creator" />
<textbox value="auto fill in" />
</row>
<row>
<label value="creator" />
<textbox value="auto fill in" />
</row>
<row>
<label value="creator" />
<textbox value="auto fill in" />
</row>
<row>
<label value="creator" />
<textbox value="auto fill in" />
</row>
<row>
<label value="creator" />
<textbox value="auto fill in" />
</row>
</rows>
</grid>
</tabpanel>
<tabpanel vflex="1">
<button label="add recipient" />
<listbox>
<listhead>
<listheader label="name" />
<listheader label="status" vflex="min" />
<listheader label="delete" width="50px" />
</listhead>
<template name="model">
<listitem>
<listcell>
<label value="name" />
</listcell>
<listcell>
<label value="status" />
</listcell>
<listcell>
<button label="delete" />
</listcell>
</listitem>
</template>
</listbox>
</tabpanel>
<tabpanel vflex="1">
<grid>
<columns>
<column hflex="min" align="right" />
<column hflex="1" />
</columns>
<rows>
<row>
<label value="Link" />
<textbox value="link" width="80%" />
</row>
<row>
<label value="Description" />
<textbox value="description" width="80%" />
</row>
</rows>
</grid>
</tabpanel>
<tabpanel vflex="1">
<button label="add comment" />
<listbox>
<listhead>
<listheader label="By" vflex="min" />
<listheader label="comment" />
</listhead>
<template name="model">
<listitem>
<listcell>
<label value="name" />
</listcell>
<listcell>
<label value="comment" />
</listcell>
</listitem>
</template>
</listbox>
</tabpanel>
<tabpanel vflex="1">
<fileupload label="add attachment" />
<listbox>
<listhead>
<listheader label="name" />
<listheader label="download" vflex="min" />
<listheader label="delete" width="50px" />
</listhead>
<template name="model">
<listitem>
<listcell>
<label value="name" />
</listcell>
<listcell>
<button label="download" />
</listcell>
<listcell>
<button label="delete" />
</listcell>
</listitem>
</template>
</listbox>
</tabpanel>
<tabpanel vflex="1">
<grid>
<columns>
<column hflex="min" align="right" />
<column hflex="1" />
</columns>
<rows>
<row>
<label value="Claimer" />
<hlayout width="80%">
<textbox value="claimer" hflex="1" />
<button label="Claim task" />
</hlayout>
</row>
<row>
<label value="info" width="80%" />
<textbox value="info" rows="15" width="80%" />
</row>
<row>
<label value="Complete task"/>
<button label="Finish Task" />
</row>
</rows>
</grid>
<button label="add subTask" />
<listbox>
<listhead>
<listheader label="subtask" />
<listheader label="status" vflex="min" />
</listhead>
<template name="model">
<listitem>
<listcell>
<label value="name" />
</listcell>
<listcell>
<button label="download" />
</listcell>
</listitem>
</template>
</listbox>
</tabpanel>
<tabpanel vflex="1">
<listbox>
<listhead>
<listheader label="By" vflex="min" />
<listheader label="action" />
</listhead>
<template name="model">
<listitem>
<listcell>
<label value="name" />
</listcell>
<listcell>
<label value="action" />
</listcell>
</listitem>
</template>
</listbox>
</tabpanel>
</tabpanels>
</tabbox>
</div>
welcome.zulzul<div apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('pkg$.MainframeVM')">
<button label="add" onClick="@command('add')" />
<vlayout>
<button label="share link" onClick="@command('shareLink')" />
<label value="@load(vm.link)" visible="@load(not empty vm.link)" />
</vlayout>
<tabbox id="tabs">
<tabs />
<tabpanels />
</tabbox>
</div>
MainframeVM.javajava
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Map;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.AfterCompose;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.GlobalCommand;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.bind.annotation.QueryParam;
import org.zkoss.bind.annotation.SelectorParam;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zul.Tab;
import org.zkoss.zul.Tabbox;
import org.zkoss.zul.Tabpanel;
/**
*
* @author cossaer.f
*/
public class MainframeVM {
private Tabbox tabbox;
private String link;
@AfterCompose // @Init doesn't work => is before compose so @SelectorParam will be null. Normally you use @Init!!
public void init(@QueryParam("task") String tasks, @QueryParam("activity") String activitys, @SelectorParam("#tabs") Tabbox tabs) throws UnsupportedEncodingException {
this.tabbox = tabs;
if (tasks != null) {
openTabs(tasks, "Task");
}
if (activitys != null) {
openTabs(activitys, "Activity");
}
}
private void openTabs(String params, String type) throws UnsupportedEncodingException {
String decoded = new String("1;2;3");//Base64.decode(params.toCharArray()), "UTF-8");
for (String param : decoded.split(";")) {
final Tab tab = new Tab(type + " : " + param);
tab.setClosable(true);
tab.setAttribute("typeId", param);
tab.setAttribute("type", type);
tabbox.getTabs().appendChild(tab);
final Tabpanel panel = new Tabpanel();
tabbox.getTabpanels().appendChild(panel);
Map<String, Object> args = new HashMap<String,Object>();
args.put("task", param);
Executions.createComponents("task/task.zul", panel, args);
tab.addEventListener("onClose", new EventListener<Event>() {
@Override
public void onEvent(Event t) throws Exception {
tabbox.getTabs().removeChild(tab);
tabbox.getTabpanels().removeChild(panel);
refreshLink(null);
}
});
}
}
@Command
@NotifyChange("link")
public void add() {
link = null;
int count = tabbox.getTabpanels().getChildren().size();
final Tab tab = new Tab("Task : " + count);
tab.setClosable(true);
tab.setAttribute("type", "Task");
tab.setAttribute("typeId", String.valueOf(count));
tabbox.getTabs().appendChild(tab);
final Tabpanel panel = new Tabpanel();
tabbox.getTabpanels().appendChild(panel);
Map<String, Object> args = new HashMap<String, Object>();
args.put("task", count);
Executions.createComponents("task.zul", panel, args);
tab.addEventListener("onClose", new EventListener<Event>() {
@Override
public void onEvent(Event t) throws Exception {
tabbox.getTabs().removeChild(tab);
tabbox.getTabpanels().removeChild(panel);
refreshLink(null);
}
});
}
@GlobalCommand
public void createTask() {
System.out.println("createTask");
link = null;
final Tab tab = new Tab("new Task");
tab.setClosable(true);
tab.setAttribute("type", "Task");
tabbox.getTabs().appendChild(tab);
final Tabpanel panel = new Tabpanel();
tabbox.getTabpanels().appendChild(panel);
Map<String, Object> args = new HashMap<String, Object>();
Executions.createComponents("task/task.zul", panel, args);
tab.addEventListener("onClose", new EventListener<Event>() {
@Override
public void onEvent(Event t) throws Exception {
tabbox.getTabs().removeChild(tab);
tabbox.getTabpanels().removeChild(panel);
refreshLink(null);
}
});
}
@Command
@NotifyChange("link")
public void shareLink() {
String taskLink = "";
for (Component tab : tabbox.getTabs().getChildren()) {
taskLink += (String) tab.getAttribute("typeId") + ";";
}
String port = (Executions.getCurrent().getServerPort() == 8080) ? ":8080" : "";
// String taskString = "?task=" + new String(Base64.encode(taskLink.getBytes()));
link = Executions.getCurrent().getScheme() + "://" + Executions.getCurrent().getServerName() + port
+ Executions.getCurrent().getContextPath()
+ Executions.getCurrent().getDesktop().getRequestPath().replace("/WEB-INF/webpages/zk", "").replace(".zul", "");
// + taskString;
}
public void refreshLink(String text) {
link = text;
BindUtils.postNotifyChange(null, null, this, "link");
}
public String getLink() {
return link;
}
}