placing widget in listbox/dropdown in gwt
i am using gwt to build my web site. i would like to create a dropdown/listbox th开发者_如何学Goat 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
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.
Take a look at the Combobox or Suggestion box in Advanced GWT Components.
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
it is possible to use Tree inside ScrollPanel, without using nested items Tree allows TreeItem to be a Widget
精彩评论