0

checkbox多选框选择问题

asked 2009-10-10 02:48:03 +0800

ring gravatar image ring
99 1

如题:动态获取带有checkbox的列表时,发现点着点着,之前已经选中的都变成不选中了,而且还有偶尔出现只能单选,而不能多选的情况,不知哪位高手可以帮忙解决下?
页面ZUL代码如下:
<?page title="new page title" contentType="text/html;charset=UTF-8"?>
<zk>
<window apply="com.window.testCheckboxWindow">

<listbox id="box" width="250px" rows="20" fixedLayout="true"
multiple="true" checkmark="true">
<listhead>
<listheader label="Name"/>
</listhead>
</listbox>
</window>
</zk>

JAVA代码如下:
package com.window;

import java.util.ArrayList;
import java.util.List;

import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.Listbox;
import org.zkoss.zul.SimpleListModel;

public class testCheckboxWindow extends GenericForwardComposer {

private Listbox box;

public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
List list = new ArrayList();
for (int i = 0; i < 1000; i++) {
list.add("hello" + i);
}
SimpleListModel simpleListModel = new SimpleListModel(list);
box.setModel(simpleListModel);
}
}

delete flag offensive retag edit

13 Replies

Sort by » oldest newest

answered 2009-10-10 08:27:00 +0800

adam4891288 gravatar image adam4891288
657 1 5

其實我也是菜鳥啊T-T。。。最近用ZK比較多而已。
116625374
加吧~不過上的不多,而且現在在公司不能上,回家加大家。

link publish delete flag offensive edit

answered 2009-10-10 08:29:00 +0800

tabsuny gravatar image tabsuny
102

好的,好的。

link publish delete flag offensive edit

answered 2018-06-15 00:21:34 +0800

dongdong gravatar image dongdong
1

setCheckmark(true) setMultiple(true)

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-10-10 02:48:03 +0800

Seen: 1,118 times

Last updated: Jun 15 '18

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More