问题描述
我正在寻找在GWT中创建一个多选下拉列表框,但是我不确定如何去做.我希望它类似于此:
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:
有什么建议吗?
我应该使用gwt ListBox代码并将其改编为接受对象吗?还是我应该忘记他们的列表框,然后尝试从头开始制作自己的列表框?还是我应该完全朝另一个方向走?如果可能的话,我真的希望不要包括外部库(例如SmartGWT)-我试图坚持使用简单的GWT.
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.
请告知.
谢谢!
推荐答案
对于感兴趣的人,我实际上最终还是自己动手...
For anyone interested, I actually ended up rolling my own...
这是一个旁边有图像的文本框.每一个都有一个ClickHandler,可显示/隐藏位于(TextBox.left,TextBox.top + TextBox.height)的DecoratedPopupPanel.
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).
似乎可以为我正常工作-我可以在其中放入任何想要的东西.在IE中,使图像与文本框很好地对齐有点棘手,但是在FF中,它看起来很棒. :)
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. :)
谢谢!
这篇关于GWT多选下拉列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!