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 :

Another new ZK fiddle

176guest172.69.254.13419a19qgMay 17, 2024 8:45:43 AMlink

Dynamic Listbox Columns

1guest172.70.83.1082em2ouuMay 16, 2024 7:13:53 PMlink

Error dialog

2guest162.158.155.1062g9n9d2May 16, 2024 3:07:42 PMlink

Error dialog

1guest172.70.231.542g9n9d2May 16, 2024 3:06:24 PMlink

MVVM dependent comboboxes

12guest141.101.68.25184fg41May 16, 2024 2:16:55 PMlink

Another new ZK fiddle

1guest162.158.187.82r09jvbMay 16, 2024 3:23:08 AMlink

open popup with callback

1guest108.162.212.149790u9iMay 15, 2024 11:53:18 PMlink

open popup with callback

30guest108.162.212.1491kje9rvMay 15, 2024 11:52:46 PMlink

PDFObject - ZK

63guest172.69.214.221hlaak0May 14, 2024 5:27:57 PMlink

EmailTemplate-Asim

1guest141.101.76.232ivbacvMay 14, 2024 4:27:59 PMlink

Another new ZK fiddle

175guest162.158.189.22419a19qgMay 7, 2024 5:25:10 AMlink

resources

index.zulzul<zk> <window border="normal" title="hello" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('pkg$.ViewModel')"> <div>Welcome to ZK Fiddle , run it right now!</div> <!-- <combobox selectedItem="@bind(vm.dialPrefix) @converter('pkg$.MyConverter')" model="@load(vm.dialPrefixes)" value="@bind(vm.dialPrefix) @converter('pkg$.MyConverter')" readonly="true"> <template name="model" var="dialPrefixSuggestion"> <comboitem label="@load(dialPrefixSuggestion.label)" value="@load(dialPrefixSuggestion.value)" /> </template> </combobox> --> <combobox selectedItem="@bind(vm.dialPrefix) @converter('pkg$.MyConverter')" model="@load(vm.dialPrefixes)" autodrop="true" value="@bind{vm.dialPrefix) @converter('pkg$.MyConverter')"> <template name="model" var="dialPrefixSuggestion"> <comboitem label="@load(dialPrefixSuggestion.label)" value="@load(dialPrefixSuggestion.value)" /> </template> </combobox> <label>Data: </label> <label value="@bind(vm.dialPrefix)"/> </window> </zk> ViewModel.javajavaimport org.zkoss.zk.ui.*; import org.zkoss.zk.ui.event.*; import org.zkoss.zk.ui.util.*; import org.zkoss.zk.ui.ext.*; import org.zkoss.zk.au.*; import org.zkoss.zk.au.out.*; import org.zkoss.zul.*; import java.util.*; import org.zkoss.bind.annotation.*; public class ViewModel { public ListModelList getDialPrefixes() { ListModelList model = new ListModelList(); ArrayList data = new ArrayList(); data.add(new DialPrefixSuggestion("Default", null)); data.add(new DialPrefixSuggestion("0", "0x")); data.add(new DialPrefixSuggestion("9", "9x")); data.add(new DialPrefixSuggestion("4", "4x")); // return new SimpleListModel(data); model.addAll(data); return model; } public String dialPrefix = "9x"; public void setDialPrefix(String str) { this.dialPrefix = str; } public void setDialPrefix(DialPrefixSuggestion x) { this.dialPrefix = x.getValue(); } private DialPrefixSuggestion suggestion = new DialPrefixSuggestion("5","5x") ; public void setSuggestion(DialPrefixSuggestion x) { this.suggestion = x; } public DialPrefixSuggestion getSuggestion() { return suggestion; } public String getDialPrefix() { return dialPrefix; } @Command public void logPrefix() { } } DialPrefixSuggestion.javajavaimport org.zkoss.zk.ui.*; import org.zkoss.zk.ui.event.*; import org.zkoss.zk.ui.util.*; import org.zkoss.zk.ui.ext.*; import org.zkoss.zk.au.*; import org.zkoss.zk.au.out.*; import org.zkoss.zul.*; public class DialPrefixSuggestion { private String label; private String value; public DialPrefixSuggestion(String label, String value) { this.label = label; this.value = value; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } } MyConverter.javajavaimport org.zkoss.zk.ui.*; import org.zkoss.zk.ui.event.*; import org.zkoss.zk.ui.util.*; import org.zkoss.zk.ui.ext.*; import org.zkoss.zk.au.*; import org.zkoss.zk.au.out.*; import org.zkoss.zul.*; import java.util.*; import org.zkoss.bind.*; public class MyConverter<V> implements Converter<Comboitem, String, Combobox> { private static int counter = 1; @Override public Comboitem coerceToUi(String val, Combobox comp, BindContext ctx) { List<Comboitem> listitems = comp.getItems(); Messagebox.show("coerseToUI"+ "Counter: " + counter++ + "\nSize:" + listitems.size()+ "\nContext: " + ctx + "\nComponent: " + comp + "\nBindContextComponent: " + ctx.getComponent() + "\nBindContextEvent: " + ctx.getTriggerEvent() + "\nObject: " + val + "\nselectedItem: " + comp.getSelectedItem(), "Information", Messagebox.OK, Messagebox.INFORMATION); for (Comboitem listItem : listitems) { if (listItem.getValue() != null && listItem.getValue().equals(val)) { Messagebox.show("Returning " + listItem.getValue(), "Information", Messagebox.OK, Messagebox.INFORMATION); return listItem; } } return listitems.isEmpty() ? null : listitems.get(0); // return "dummyUI"; } @Override @SuppressWarnings("unchecked") public String coerceToBean(Comboitem val, Combobox comp, BindContext ctx) { /** Messagebox.show("coerseToBean"+ "\nCounter: " + counter++ + "\nContext: " + ctx + "\nComponent: " + comp + "\nObject: " + val, "Information", Messagebox.OK, Messagebox.INFORMATION); **/ if (val instanceof Comboitem) { Comboitem item = (Comboitem) val; Messagebox.show("Item: " + item.getClass().getName() + "\nValue:" + item.getValue(), "Information", Messagebox.OK, Messagebox.INFORMATION); return val == null ? null : (String) comp.getSelectedItem().getValue(); } return null; } }multiLineMessageBox.zulzul<?xml version="1.0" encoding="UTF-8"?> <?page title="Multiline Messagebox" language="xul/html"?> <window border="none" width="300px" closable="true" use="org.zkoss.zul.impl.MessageboxDlg"> <style dynamic="true"> .myMultiMessageBox .z-panel-header { background: #FC7A7C -1px; font-weight:bold; zoom: 1; border: 1px solid; line-height: 15px;} .myMultiMessageBox .z-panel-body { border-style:none solid solid; border-width:0 1px 1px; overflow:hidden; padding:0px; } </style> <panel title="${arg.title}" border="normal" sclass="myMultiMessageBox"> <panelchildren style="background-color: white;"> <hbox> <div class="${arg.icon}" /> <div sclass="z-messagebox" width="100%"> <label multiline="true" value="${arg.message}" sclass="word-wrap" width="100%" /> </div> <div width="10px" /> </hbox> <separator bar="true" /> <hbox style="margin-left:auto; margin-right:auto"> <button id="btn1" identity="${arg.OK}" autodisable="self" sclass="z-messagebox-btn" use="org.zkoss.zul.impl.MessageboxDlg$Button" if="${!empty arg.OK}" /> <button identity="${arg.CANCEL}" autodisable="self" sclass="z-messagebox-btn" use="org.zkoss.zul.impl.MessageboxDlg$Button" if="${!empty arg.CANCEL}" /> <button identity="${arg.YES}" sclass="z-messagebox-btn" autodisable="self" use="org.zkoss.zul.impl.MessageboxDlg$Button" if="${!empty arg.YES}" /> <button identity="${arg.NO}" sclass="z-messagebox-btn" use="org.zkoss.zul.impl.MessageboxDlg$Button" if="${!empty arg.NO}" /> <button identity="${arg.RETRY}" autodisable="self" sclass="z-messagebox-btn" use="org.zkoss.zul.impl.MessageboxDlg$Button" if="${!empty arg.RETRY}" /> <button identity="${arg.ABORT}" autodisable="self" sclass="z-messagebox-btn" use="org.zkoss.zul.impl.MessageboxDlg$Button" if="${!empty arg.ABORT}" /> <button identity="${arg.IGNORE}" autodisable="self" sclass="z-messagebox-btn" use="org.zkoss.zul.impl.MessageboxDlg$Button" if="${!empty arg.IGNORE}" /> </hbox> <separator></separator> </panelchildren> </panel> </window>MultiLineMessageBox.javajava /** * Copyright 2010 the original author or authors. * * This file is part of Zksample2. http://zksample2.sourceforge.net/ * * Zksample2 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Zksample2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Zksample2. If not, see <http://www.gnu.org/licenses/gpl.html>. */ import java.io.Serializable; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zul.Messagebox; /** * Extended messagebox that can show multilined messages. <br> * Lines can be breaked with the \n . <br> * <br> * * @changes 04.07.2009/sge extended for showing the icons <br> * 05.07.2009/sge added an empty line before and after the message. <br> * 08.07.2009/sge added for the EventListener * * @author sgerth */ public class MultiLineMessageBox extends Messagebox implements Serializable { private static final long serialVersionUID = 1L; // path of the messagebox zul-template private transient static String _templ = "multiLineMessageBox.zul"; public MultiLineMessageBox() { } public static void doSetTemplate() { setTemplate(_templ); } /** * Shows a message box and returns what button is pressed. A shortcut to * show(message, null, OK, INFORMATION). <br> * <br> * Simple MessageBox with customizable message and title. <br> * * @param message * The message to display. * @param title * The title to display. * @param icon * The icon to display. <br> * QUESTION = "z-msgbox z-msgbox-question"; <br> * EXCLAMATION = "z-msgbox z-msgbox-exclamation"; <br> * INFORMATION = "z-msgbox z-msgbox-imformation"; <br> * ERROR = "z-msgbox z-msgbox-error"; <br> * @param buttons * MultiLineMessageBox.CANCEL<br> * MultiLineMessageBox.YES<br> * MultiLineMessageBox.NO<br> * MultiLineMessageBox.ABORT<br> * MultiLineMessageBox.RETRY<br> * MultiLineMessageBox.IGNORE<br> * @param padding * true = Added an empty line before and after the message.<br> * * * @return * @throws InterruptedException */ public static final int show(String message, String title, int buttons, String icon, boolean padding) throws InterruptedException { String msg = message; if (padding == true) { msg = "\n" + message + "\n\n"; } if (icon.equals("QUESTION")) { icon = "z-msgbox z-msgbox-question"; } else if (icon.equals("EXCLAMATION")) { icon = "z-msgbox z-msgbox-exclamation"; } else if (icon.equals("INFORMATION")) { icon = "z-msgbox z-msgbox-imformation"; } else if (icon.equals("ERROR")) { icon = "z-msgbox z-msgbox-error"; } return show(msg, title, buttons, icon, 0, null); } /** * Shows a message box and returns what button is pressed. A shortcut to * show(message, null, OK, INFORMATION). <br> * <br> * Simple MessageBox with customizable message and title. <br> * * @param message * The message to display. * @param title * The title to display. * @param icon * The icon to display. <br> * QUESTION = "z-msgbox z-msgbox-question"; <br> * EXCLAMATION = "z-msgbox z-msgbox-exclamation"; <br> * INFORMATION = "z-msgbox z-msgbox-imformation"; <br> * ERROR = "z-msgbox z-msgbox-error"; <br> * @param buttons * MultiLineMessageBox.CANCEL<br> * MultiLineMessageBox.YES<br> * MultiLineMessageBox.NO<br> * MultiLineMessageBox.ABORT<br> * MultiLineMessageBox.RETRY<br> * MultiLineMessageBox.IGNORE<br> * @param padding * true = Added an empty line before and after the message.<br> * * * @return * @throws InterruptedException */ public static final int show(String message, String title, int buttons, String icon, boolean padding, EventListener listener) throws InterruptedException { String msg = message; if (padding == true) { msg = "\n" + message + "\n\n"; } if (icon.equals("QUESTION")) { icon = "z-msgbox z-msgbox-question"; } else if (icon.equals("EXCLAMATION")) { icon = "z-msgbox z-msgbox-exclamation"; } else if (icon.equals("INFORMATION")) { icon = "z-msgbox z-msgbox-imformation"; } else if (icon.equals("ERROR")) { icon = "z-msgbox z-msgbox-error"; } return show(msg, title, buttons, icon, 0, listener); } }MyTypeConverter.javajavaimport org.zkoss.zk.ui.*; import org.zkoss.zk.ui.event.*; import org.zkoss.zk.ui.util.*; import org.zkoss.zk.ui.ext.*; import org.zkoss.zk.au.*; import org.zkoss.zk.au.out.*; import org.zkoss.zul.*; import org.zkoss.zkplus.databind.*; public class MyTypeConverter implements TypeConverter { public Object coerceToBean(java.lang.Object val, org.zkoss.zk.ui.Component comp) { return null; } public Object coerceToUi(java.lang.Object val, org.zkoss.zk.ui.Component comp) { ((Comboitem) comp).setLabel("choosen"); ((Comboitem) comp).setValue(val); return null; } }