Zk 中 两列 listbox资料转移,并获得 listbox中的值
来源:互联网 发布:网络之大神我只是路过 编辑:程序博客网 时间:2024/06/05 00:54
<hlayout height="160px" width="260px"> <listbox id="candidateLb" hflex="1" vflex="true" multiple="true" rows="8"> <listhead> <listheader label="合同成品" width="80px" ></listheader> </listhead> </listbox> <vbox spacing="10px" width="24px"> <image style="cursor:pointer" id="chooseAllBtn" src="/img/rightrightarrow_g.png" /> <image style="cursor:pointer" id="chooseBtn" src="/img/rightarrow_g.png" /> <image style="cursor:pointer" id="removeBtn" src="/img/leftarrow_g.png" /> <image style="cursor:pointer" id="removeAllBtn" src="/img/leftleftarrow_g.png" /> </vbox> <listbox id="chosenLb" hflex="1" vflex="true" multiple="true" rows="8"> <listhead> <listheader label="已選成品" width="80px"></listheader> </listhead> <template name="model"> <listitem> </listitem> </template> </listbox> </hlayout>
java页面处理
public void onClick$chooseBtn() throws Exception{if(candidateLb.getSelectedIndex()<0) {MyMessagebox.info("請選中合同成品資料.");return;}String files=this.candidateLb.getSelectedItem().getValue();candidateLb.removeItemAt(candidateLb.getSelectedIndex());chosenLb.appendItem(files,files);}public void onClick$removeBtn() throws Exception{if(chosenLb.getSelectedIndex()<0){MyMessagebox.info("請選中已選成品資料.");return;}String files=this.chosenLb.getSelectedItem().getValue();chosenLb.removeItemAt(chosenLb.getSelectedIndex());candidateLb.appendItem(files,files);}public void onClick$chooseAllBtn() throws Exception{if(lstcontractno.getSelectedIndex()<0) return;chosenLb.getItems().clear();String parax=lstcontractno.getSelectedItem().getValue().toString().toUpperCase();JdbcDao dao=JdbcFactory.getDgWofeJdbcDao(plant);String sql=" select sequenceno||'.'||itemno as consumelst from ct_t_contractitem where class='0' AND contractid='"+parax+"'";ArrayList<LinkedHashMap> lstRet= dao.query(sql);for(LinkedHashMap map: lstRet){chosenLb.appendItem((String)map.get("CONSUMELST"),(String)map.get("CONSUMELST"));}candidateLb.getItems().clear();}public void onClick$removeAllBtn() throws Exception{onSelect$lstcontractno(); //查询出来的所有资料chosenLb.getItems().clear();}
获得已选资料的笔数 this.chosenLb.getItems().size();
获得已选资料 (因我的资料是两个栏位合成,所有有进行字符截取)
String sequence_no="",item_no="";
List<Listitem> list = this.chosenLb.getItems();
if(list != null){
int index = 0;
double c = ((double) list.size())/5;
index=(int) Math.ceil(c);
for(int i = 0; i < list.size(); i++){
String itemx = list.get(i).getValue();
String a[] = itemx.split("\\."); //截取字符串
if(i < list.size()-1){
sequence_no+="'"+a[0]+"',";
item_no+="'"+a[1]+"',";
}else{
sequence_no+="'"+a[0]+"'";
item_no+="'"+a[1]+"'";
}
}
}
0 0
- Zk 中 两列 listbox资料转移,并获得 listbox中的值
- zk listbox
- zk 中 获取listbox里被选中的列的列号
- zk中解决listbox延迟加载问题
- 获取listbox中的值
- 在zk中如何让listbox出现滚动条
- ListBox 中获得选中项的方法
- 两个ListBox中的itme相互转移过程中的一个问题
- listBox中的值添加到另一个listbox中,支持多选和去重项
- listbox
- listbox
- ListBox
- listbox
- Listbox
- listbox
- ListBox
- LISTBOX
- ListBox
- 洛谷 P1087 FBI树
- 已解决:"通配符的匹配很全面, 但无法找到元素 'tx:annotation-driven' 的声明"等
- MongoDB使用小结:一些常用操作分享
- Apache的URL地址重写(RewriteCond与RewriteRule)
- nodejs和npm关系
- Zk 中 两列 listbox资料转移,并获得 listbox中的值
- ubuntu 更新源
- React Native学习一:初识React Native
- 生成mac的公钥 密钥
- android开发之EditText属性详解
- Spring MVC教程快速入门
- 路由算法入门
- Java 发送 Email
- java异常 java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter