gwtbootstrap3 / gwtbootstrap3-extras

Extra (third party) wrappers for GwtBootstrap3
Apache License 2.0
43 stars 89 forks source link

The library returns a JsArrayNumber for RangeSlider #217

Closed BenDol closed 9 years ago

BenDol commented 9 years ago

This means we need to provide an Object for the formatter callbacks to format the result of a range of values.

sjardine commented 9 years ago

@crevete Do you have an opinion on this? I'm not familiar with the RangeSlider code.

BenDol commented 9 years ago

This can either have overriding in the RangeSlider class (probably ideal, not something I have time to do) or more simple fix just dynamically box the return type as an Object like I have done here. Then at least we can determine what was resulted and are able to format the new value properly. Normal Slider returns a double value, the RangeSlider returns a JsArrayNumber with 2 double values.

crevete commented 9 years ago

@BenDol you are right, this is a bug of the Slider wrapper. But your current fix (it may work, don't test yet) does not properly the work. It would better to make the FormatCallback generic : FormatCallback<T>, just like the rest of implementation of normal and range sliders. I'll make a PR to fix this properly and also update the demo page. Thanks anyway!