Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A gwt dropdown ListBox that can have values manually type in?

Tags:

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.

like image 889
benstpierre Avatar asked Nov 13 '22 14:11

benstpierre


1 Answers

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

like image 175
Fritz H Avatar answered Apr 04 '23 21:04

Fritz H