Input Range Slider is one of the coolest components of ADF which is not only very intuitive for users but also gives a 'cool' look to the page :)
So how do we get minimum and maximum values selected on the slider?
Among other properties of this component are 'minimum' and a 'maximum' and then there is 'value'. This causes some confusion as to how can we get the values selected on the slider. This is not half as complex as it seems!
Let's focus first on the 'value'. The value of this component is returned in form of a oracle.adf.view.rich.model.NumberRange object.
oracle.adf.view.rich.model.NumberRange minMax = (oracle.adf.view.rich.model.NumberRange)getInputRangeSlider().getValue();
You can extract both the minimum and maximum values from this object like this:
int startValue = minMax.getMinimum().intValue();
int endValue = minMax.getMaximum().intValue();
and that's it. You have both the values returned by the slider.
'Minimum' and 'Maximum' attributes define the minimum and maximum values that your slider will show. By default minimum is 0 and maximum is 10 and the slider shows numbers from 0 to 10. You can set your own values programmatically for both the attributes.
minimum="#{pageFlowScope.MyBackingBean.minimumValue}"
maximum="#{pageFlowScope. MyBackingBean.maximumValue}"
and on runtime your slider will show the values set by these EL expressions.
Among other common properties are orientation and increment related properties using which you can change orientation of the slider from horizontal to vertical or change the minimum increment value to define minimum difference between minimum and maximum values.
So go on. Take this range slider out for a spin!
So how do we get minimum and maximum values selected on the slider?
Among other properties of this component are 'minimum' and a 'maximum' and then there is 'value'. This causes some confusion as to how can we get the values selected on the slider. This is not half as complex as it seems!
Let's focus first on the 'value'. The value of this component is returned in form of a oracle.adf.view.rich.model.NumberRange object.
oracle.adf.view.rich.model.NumberRange minMax = (oracle.adf.view.rich.model.NumberRange)getInputRangeSlider().getValue();
You can extract both the minimum and maximum values from this object like this:
int startValue = minMax.getMinimum().intValue();
int endValue = minMax.getMaximum().intValue();
and that's it. You have both the values returned by the slider.
'Minimum' and 'Maximum' attributes define the minimum and maximum values that your slider will show. By default minimum is 0 and maximum is 10 and the slider shows numbers from 0 to 10. You can set your own values programmatically for both the attributes.
minimum="#{pageFlowScope.MyBackingBean.minimumValue}"
maximum="#{pageFlowScope. MyBackingBean.maximumValue}"
and on runtime your slider will show the values set by these EL expressions.
Among other common properties are orientation and increment related properties using which you can change orientation of the slider from horizontal to vertical or change the minimum increment value to define minimum difference between minimum and maximum values.
So go on. Take this range slider out for a spin!
Comments