问题
I'm looking to create a multi-select dropdown listbox in GWT, but I'm not sure how to go about doing so. I'd like it to be similar to this:
Any suggestions?
Should I take gwt ListBox code and adapt it to accept objects? Or should I forget their Listbox and try to make my own from scratch? Or should I go in a different direction completely? I'd really prefer not to include external libraries (like SmartGWT) if possible - I'm trying to stick with straight-up GWT.
Please advise.
Thanks!
回答1:
For anyone interested, I actually ended up rolling my own...
It's a TextBox with an Image next to it. And each of these has a ClickHandler that shows/hides a DecoratedPopupPanel positioned at (TextBox.left, TextBox.top + TextBox.height).
Seems to work alright for me - and I can put anything I want in it. Getting the Image to line up nicely with the Textbox is a little tricky in IE, but in FF it looks great. :)
Thanks!
回答2:
I'm planning a UI that also has a multi-select requirement.
I currently intend using a popup dialog following the List-Builder UI pattern, which can be easier to navigate than a multi-select drop-down list - particularly with long lists. It's simplicity means you'll only need to use a plain list, not a drop-down/combo.
来源:https://stackoverflow.com/questions/5570232/gwt-multiselect-dropdown-listbox