可以手动输入值的 gwt 下拉列表框?
我们基于 GWT 的应用程序需要一个字体大小选择器。通常人们会想从一组标准大小中选择字体大小。然而,有时用户会想要手动输入特定的字体大小,例如“12.6”。显然,我们不能将十分之一的点选项放入字体大小下拉列表中,因此可以手动输入任何值的下拉列表是最有意义的。
有人告诉我 simple-gwt 有一个名为 ComboBox 的小部件,但它似乎适用于旧版本的 gwt(我们使用的是最新版本 - 2.4)。 Suggestbox 可以工作,但没有“下拉”箭头来弹出建议,因此不想输入尺寸的用户无法使用它。
有什么建议吗?我很惊讶这个小部件没有内置到 GWT 中。
Our GWT based application needs a font size selector. Ussually people will want to pick the font size from a set of standard sizes. Sometimes however users will want to manually type in a specific font size like '12.6'. We obviously cannot put ever tenth of a point option inside our font size dropdown so a dropdown that can have any value entered manually would make the most sense.
I was told simple-gwt has a widget called ComboBox but it appears to be meant for an older version of gwt (we are on the latest - 2.4). Suggestbox would work except there is no "dropdown" arrow to popup the suggestions so users who do not want to type the size cannot use it.
Any suggestions? I was surprised this widget was not built into GWT.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要使用的小部件是 SuggestBox - 您可能能够也可能无法扩展它以使用单击处理程序来显示一组默认建议(可能有一个属性允许它)并使用 CSS 来显示下拉箭头。
javadoc 位于: http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/SuggestBox.html
示例:http://examples.roughian.com/index.htm#Widgets~SuggestBox
The widget to use is the SuggestBox - you may or may not be able to extend it to use a click handler to show a set of default suggestions (there may be a property to allow it) and to use CSS to show a dropdown arrow.
javadoc here: http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/SuggestBox.html
Example here: http://examples.roughian.com/index.htm#Widgets~SuggestBox
我知道 Smart GWT 和 ext-gwt 有提供此类功能的小部件,但这些库都不是免费的。
当然,您随时可以自己推出。
I know that Smart GWT and ext-gwt have widgets that provide this kind of functionality, but neither of those libraries are free.
Of course you could always roll your own.
我找到了这个库“高级 GWT 组件”。它是一个免费的库,包含 GWT 小部件。
I found this library "Advanced GWT components". It is a free library that has drop in GWT widgets.