combobox.zul

来自「ZK是一个Ajax Java Web框架」· ZUL 代码 · 共 56 行

ZUL
56
字号
<?xml version="1.0" encoding="UTF-8"?><!--combobox.zul{{IS_NOTE	Purpose:			Description:			History:		Mon Oct 13 15:52:14     2008, Created by jumperchen}}IS_NOTECopyright (C) 2008 Potix Corporation. All Rights Reserved.{{IS_RIGHT}}IS_RIGHT--><window title="Test of Combobox's Serialization"><vbox id="vb">   <zk>  <zscript>    String[] data = new String[30];    for(int j=0; j &lt; data.length; ++j) {      data[j] = "option "+j;    }    ListModel strset = new SimpleListModel(data);  </zscript>  <combobox autodrop="true" id="list" width="200px" model="&#36;{strset}"/> </zk>	<zscript>	int cnt = 0;	</zscript>	<button label="Clone">		<attribute name="onClick">{	Object l = list.clone();	l.setId("dst" + ++cnt);	vb.insertBefore(l, self);		}</attribute>	</button>	<button label="Clone by Serialization">		<attribute name="onClick">{	import java.io.*;	ByteArrayOutputStream boa = new ByteArrayOutputStream();	new ObjectOutputStream(boa).writeObject(list);	byte[] bs = boa.toByteArray();	Object l = new ObjectInputStream(new ByteArrayInputStream(bs)).readObject();	l.setId("dst" + ++cnt);	vb.insertBefore(l, self);	vb.insertBefore(new Label(bs.length+" bytes copied"), self);		}</attribute>	</button></vbox></window>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?