databindgrid.zul

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

ZUL
64
字号
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?> <zk><zscript src="Person.zs"/><window id="mainwin" xmlns:a="http://www.zkoss.org/2005/zk/annotation">  <a:bind model="personList"/>  <grid width="800px" height="200px">    <columns>      <column width="200px"/>      <column width="200px"/>      <column width="200px"/>      <column width="200px"/>    </columns>    <rows>	    <a:bind _var="person"/>	    <row>	        <a:bind value="person.firstName"/>	        <textbox id="fn"/>	        <a:bind value="person.lastName"/>	        <textbox id="ln"/>	        <a:bind value="person.fullName"/>	        <label maxlength="20"/>	        <a:bind model="emailList" selectedItem="person.email"/>	        <listbox mold="select" rows="1">	        	<a:bind _var="email" label="email"/>	        	<listitem/>	        </listbox>	    </row>    </rows>	</grid> 	<zscript>		//prepare collection list	setupPerson(Person person, int j) {	  person.setFirstName("First"+j);	  person.setLastName("Last"+j);	  person.setEmail("email"+j+"@potix.com");	}		//prepare the example person List	int count = 30;	List personList = new ArrayList();	for(int j= 0; j &lt; count; ++j) {	  Person personx = new Person();	  if (j == 1) {	  	personx.setAddress(new Address());	  	selected = personx;	  }	  setupPerson(personx, j);	  personList.add(personx);	}      //prepare email list  Set emailList = new LinkedHashSet();  for(int j= 0; j &lt; count; ++j) {    emailList.add("email"+j+"@potix.com");  }	</zscript></window></zk>

⌨️ 快捷键说明

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