开发者

How to set single selection for GWT multiselect Listbox?

开发者 https://www.devze.com 2023-02-20 14:09 出处:网络
I created multiselect Listbox (with parametr true in constructor). How to set him single select mode with m开发者_开发百科ulti select View (It looks like multi select but I can select only 1 record )?

I created multiselect Listbox (with parametr true in constructor). How to set him single select mode with m开发者_开发百科ulti select View (It looks like multi select but I can select only 1 record )?

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. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消