问题
i am using gwt to build my web site. i would like to create a dropdown/listbox that contains no just text but also images, meaning that in the drop down there will be a what ever widget that ill create.
please advise jaimon
回答1:
You won't be able to do this with a ListBox, because it just creates an HTML < select> element.
You can use a MenuBar that has one menu with MenuItems in it to simulate a dropdown with complex widgets inside it. You will also be able to style the dropdown rather than rely on browser-styled form elements.
回答2:
Take a look at the Combobox or Suggestion box in Advanced GWT Components.
回答3:
Another widget is the DropDownListBox in the GWT incubator. I have not used it, but the stated intent is to provide a rich, stylable ListBox. You can pass raw HTML to the addItem() method.
DropDownListBox
回答4:
it is possible to use Tree inside ScrollPanel, without using nested items Tree allows TreeItem to be a Widget
来源:https://stackoverflow.com/questions/1766842/placing-widget-in-listbox-dropdown-in-gwt