Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    minValueLabel does not display correctly

    I am incorporating Smart GWT sliders into a GWT application, and when I set the minValue of the slider to 0 and the minValueLabel to "0%", the label does not display as "0%". It displays simply as "0". If I change the minValue to something else like 1, the label displays correctly as "0%". Does anyone know why this might be happening? I am using Smart GWT version 2.5 and I've also tested with version 3.0. It doesn't work in either version. I am testing using Firefox 10.0.2 and Chrome 17.0.963.83 m. Following are snippets of my code:

    From my view Java class:
    Code:
    view.setSliderMinValue(0);
    From my view ui.xml:
    Code:
    <sgwt:Slider ui:field="slider" vertical="false" minValueLabel="0%" maxValueLabel="100%" showTitle="false"/>

    #2
    The code within my view class follows:

    Code:
    @Override
    public void setSliderMinValue(float value) {
    	slider.setMinValue(value);
    }

    Comment


      #3
      I came up with a solution. To get the slider to display correctly, it is essential that the slider's showTitle attribute is set AFTER the minValue and maxValue attributes are set in the Java code. Strangely, you can't set this attribute in the ui.xml file and get the slider to display correctly. It must be set within Java code.

      Following is an example:

      Java code:
      Code:
      slider.setMinValue(0f);
      slider.setMaxValue(100f);
      slider.setShowTitle(false);
      slider.setValue(90f);
      ui.xml code:
      Code:
      <sgwt:Slider ui:field="slider" vertical="false" minValueLabel="0%" maxValueLabel="100%" length="400" />

      Comment

      Working...
      X