简体   繁体   English

如何为GWT多选列表框设置单选?

[英]How to set single selection for GWT multiselect Listbox?

I created multiselect Listbox (with parametr true in constructor). 我创建了多选列表框(在构造函数中使用parametr true)。 How to set him single select mode with multi select View (It looks like multi select but I can select only 1 record )? 如何为他设置多选视图的单选模式(看起来像多选,但我只能选择1条记录)?

Thanks 谢谢

The documentation warns about using setMultipleSelect on InternetExplorer not working, so it may be best to recreate the widget to use false in the constructor. 该文档警告有关在InternetExplorer上使用setMultipleSelect不起作用,因此,最好重新创建窗口小部件以在构造函数中使用false But, on other browsers, this should work: 但是,在其他浏览器上,这应该可以工作:

listBox.setMultipleSelect(false); //single select mode
listBox.setVisibleItemCount(10); //the parameter is the number of rows you want to be visisble.

Again, I think the recommended way would be to create a new ListBox and re-add it, to avoid failure on IE6. 同样,我认为推荐的方法是创建一个新的ListBox并重新添加它,以避免IE6失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM