The GXT SliderField
is beautiful and fun to use, it is passed a Slider
and adapts it as an input widget for FormPanel
. There is, however, one twist to its API that I think inhibits its use and it's the fact the you have very little control over the formatting of the tooltip message shown as you drag the slider's thumb back and forth.
As of GXT 2.2.3 you can only configure the tip message by setting a single string (one size fits all) with the slider.setMessage()
method call; for example, slider.setMessage("{0} inches tall")
. With this setup, you get the tooltip formatted like "1 inches tall", "2 inches tall", "3 inches tall"
, and so on. Internally, Slider
uses Format.substitute(getMessage(), value)
such that the value of the slider is substituted into what has been set with setMessage()
method.
If we have a Slider
configured to slide from 1
to 5
and need to use it to implement, say, a rating control such that the value 1
could mean Poor and the value 5
could...