10.7. <rich:inputNumberSlider>
The
<rich:inputNumberSlider> component provides a slider for changing numerical values. Optional features include control arrows to step through the values, a tool-tip to display the value while sliding, and a text field for typing the numerical value which can then be validated against the slider's range.
10.7.1. Basic usage
Basic use of the component with no attributes specified will render a slider with a minimum value of 0, a maximum of 100, and a gradient step of 1, together with a text field for typing the desired numerical value. The slider is labeled with the minimum and maximum boundary values, and a tool-tip showing the current value is shown while sliding the slider. The
value attribute is used for storing the currently selected value of the slider. Standard conversion and validation for the JSF UIInput component is applied.
10.7.2. Interactivity options
The text field can be removed by setting
showInput="false".
The properties of the slider can be set with the attributes
minValue, maxValue, and step.
The minimum and maximum labels on the slider can be hidden by setting
showBoundaryValues="false". The tool-tip showing the current value can be hidden by setting showToolTip="false".
Arrow controls can be added to either side of the slider to adjust the value incrementally by setting
showArrows="true". Clicking the arrows move the slider indicator in that direction by the gradient step, and clicking and holding the arrows moves the indicator continuously. The time delay for each step when updating continuously can be defined using the delay attribute.
10.7.3. JavaScript API
The
<rich:inputNumberSlider> component can be controlled through the JavaScript API. The JavaScript API provides the following functions:
getValue()- Get the current value of the slider control.
setValue(newValue)- Set the value of the slider control to the
newValueinteger passed as a parameter. increase()- Increase the value of the slider control by the gradient step amount.
decrease()- Decrease the value of the slider control by the gradient step amount.
10.7.4. Reference data
component-type:org.richfaces.InputNumberSlidercomponent-class:org.richfaces.component.html.HtmlInputNumberSlidercomponent-family:org.richfaces.Inputrenderer-type:org.richfaces.InputNumberSliderRenderer
10.7.5. Style classes and skin parameters
Table 10.7. Style classes (selectors) and corresponding skin parameters
| Class (selector) | Skin Parameters | Mapped CSS properties |
|---|---|---|
| No skin parameters. | |
| controlBackgroundColor
|
background-color
|
panelBorderColor
|
border-bottom-color
| |
| No skin parameters. | |
| generalSizeFont
|
font-size
|
generalFamilyFont
|
font-family
| |
generalTextColor
|
color
| |
panelBorderColor
|
border-left-color
| |
| generalSizeFont
|
font-size
|
generalFamilyFont
|
font-family
| |
generalTextColor
|
color
| |
panelBorderColor
|
border-right-color
| |
| generalSizeFont
|
font-size
|
generalFamilyFont
|
font-family
| |
generalTextColor
|
color
| |
| No skin parameters. | |
| No skin parameters. | |
| No skin parameters. | |
| No skin parameters. | |
| No skin parameters. | |
| No skin parameters. | |
| No skin parameters. | |
| No skin parameters. | |
| generalSizeFont
|
font-size
|
generalFamilyFont
|
font-family
| |
generalTextColor
|
color
| |
tipBorderColor
|
border
| |
tipBackgroundColor
|
background-color
| |
