Reputation: 11
my problem is, that there are now slider elements inside GWT, so i tryed using an HTML element to work araound that problem:
HTML slider = new HTML(
"<input type=\"range\" name=\"historyRange\" min=\"-960\" max=\"960\" value=\"0\" class=\"slider\" id=\"counter\" oninput=\"this.form.historyRange.value=this.value\" />"
);
So now i only needed the value out of that slider. I tried
String test = DOM.getElementAttribute(slider.getElement(), "value");
and the same with StyleAttribute, but no luck. I tried to get the Element by ID with
String test = Document.get().getElementById("counter").getAttribute("value");
but no luck either.
I'm out of ideas here, how i can make this thing work.
Kiouri.sliderbar and Smart GWT are no options for my problem.
(termurin-11 and JetBrains GWT Plugin 221.5080.56)
Upvotes: 1
Views: 321
Reputation: 5599
GWT does not directly support <input type='range' />
elements, but it has a generic <input />
element support: InputElement.
You can cast your slider element to an InputElement this way:
InputElement input = InputElement.as(Document.get().getElementById("counter"));
To get the value just call:
input.getValue();
Upvotes: 1