将小部件放在列表框/下拉列表中 [英] placing widget in listbox/dropdown in gwt
问题描述
我使用gwt来建立我的网站。
i希望创建一个不仅包含文本而且包含图像的下拉/列表框,这意味着在下拉菜单中会有一个创建的小部件。
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.
请指教
jaimon
please advise jaimon
推荐答案
您无法使用ListBox执行此操作,因为它只是创建一个HTML< select>元素。
You won't be able to do this with a ListBox, because it just creates an HTML < select> element.
您可以使用 MenuBar ,它有一个菜单 MenuItem 来模拟其中包含复杂小部件的下拉菜单。您还可以设置下拉式样,而不是依赖浏览器样式的表单元素。
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.
这篇关于将小部件放在列表框/下拉列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!