The slider is a component equipped with a small bar, also called a thumb, that slides along a visible line.
To use the slider control, the user can drag the thumb in one of two directions. A slider is configured with a set of values from a minimum to a maximum. Therefore, the user can make a selection included in that range. Slider tag is slider i.e. <comp:slider lowerLimit = "1"
upperLimit = "50"
value = "25"
name="my_slider"/>
lowerLimit and upperLimit attributes define the numeric range of the slider. value defines the initial value. In this example, we have configured a simple slider defining a range between 1 and 50, with a default value of 25. We can also link a label to an slider control, in order to show the slider value. To do that, we just need to set the inputReceiver attribute: <comp:slider lowerLimit = "1"
upperLimit = "50"
value = "25"
inputReceiver = "slider_label_2"
name = "example2"/>
Slider value: <comp:label name="slider_label_2" text="25"/>
By default, an slider show the numeric value without decimals. To allow decimals, we can set the decimals attribute to the number of decimals to show to In the other hand, an slider is rendered in an horizontal axis by default. However we can alter it by setting the axis attribute: <comp:slider lowerLimit = "1"
upperLimit = "50"
value = "25"
axis = "vertical"
name = "example2"/>
The axis attribute allowes horizontal (by default) and vertical. Finally, we can customize the slider look & feel by setting the trackCssClass and handleImg attributes: - trackCssClass is the css class that corresponds with the slider tracking line.
- handleImg is the image that will be render as the handle (the piece that we move along the tracking line)
An example of track css class could be like the following example: .track {
background: transparent
url(track_background_image.png)
repeat-x
top left;
}
Of course, we can change the dimensions of the slider by setting the width and height attribute, as well as the handle dimensions by setting the handleWidth and handleHeight attributes. See the slider component in action here: http://www.lionframework.org/components/slider.html
| Author: | Antonio Parraga Navarro |
| Version: | 1.1.125 beta |
| Copyright: | Copyright (c) 2008 Antonio Parraga Navarro |
__UIComponent
|
--__UIContainer
|
--__InputComponent
|
--__SliderComponent
|