Friday, November 30, 2012

Use of Input Range Slider

ADF has a long list of Rich look component. They are very easy to use and they give rich look to an application. One of these cool component is Range(selector).



This component is very use full to select two number values. It has some properties by which it is controlled. these are :



Minimum : Range start point.
Maximum : Range end point
Minimum Increment : The smallest possible increment or possible increment when user presses + or – button one time
Major Increment : Distance between two major ticks, major ticks has label.
Minor Increment : Distance between two minor ticks, minor ticks do not show label.


In image:
Minimum : 0
Maximum : 100
Minimum Increment :1
Major Increment : 10
Minor Increment : 5



The main property of this component is value. It contains two values maximum and minimum. Its contains value of form oracle.adf.view.rich.model.NumberRange object.
To get its value first bind this component to java bean class.
private RichInputRangeSlider range; 

Get its value
NumberRange sliderValue =getRange().getValue(); 
To get minimum and maximum selected value :
Integer minVal = sliderValue.getMinimum().intValue(); 
Integer maxVal = sliderValue.getMaximum().intValue(); 
Now use these value as you need. Play with another component of ADF 

Adios. 

5 comments:

  1. HI,

    Is there any way to make left side slider fixed, that is not to editable. i want only right/major tick to be adjustable.

    Please let me know if you have any suggestion for this.

    thanks,
    Shivaji

    ReplyDelete
    Replies
    1. Hi Shivaji,

      Range Slider is used when you want to select between two values. for only single value selection you can use "slider(Number)" adf component.

      Regards
      Rohit

      Delete
  2. Thank you for the reply Rohit!

    actually i was using this for percent completed task, to show the completed task in percentage.

    is there any other way we can show this and get?

    let me try with number slider as well will update....

    thanks, Shivaji

    ReplyDelete
  3. hello sir
    how to set first slider to zero?

    ReplyDelete
  4. Is there any way, we can change the colour of the input number slider such that only the region from 0 to the selected value get highlighted in a different colour?

    ReplyDelete