### Create new RichFaces Documentation Jira issue

Summary
255 characters left
Description
Environment
This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.org Community Documentation

- Prev
- Next

### 6.6.5. < rich:dataFilterSlider > available since 3.0.0

expand all

#### 6.6.5.1. Description

A slider-based action component is used for filtering table data.

Figure 6.35. <rich:dataFilterSlider> component

#### 6.6.5.2. Key Features

- Filter any UIData based component in dependency on its child's values

- Fully skinnable control and input elements

- Optional value text field with an attribute-managed position

- Optional disablement of the component on a page

- Optional toolTip to display the current value while a handle is dragged

- Dragged state is stable after the mouse moves

- Optional manual input possible if a text input field is present

- Validation of manual input

Table 6.66. rich : dataFilterSlider attributes

Attribute Name | Description
--- | ---
action | MethodBinding pointing at the application action to be invoked, if this UIComponent is activated by you, during the Apply Request Values or Invoke Application phase of the request processing lifecycle, depending on the value of the immediate property
actionListener | MethodBinding pointing at method accepting an ActionEvent with return type void
ajaxSingle | Limits JSF tree processing (decoding, conversion, validation and model updating) only to a component that sends the request. Boolean
binding | JSF: The attribute takes a value-binding expression for a component property of a backing bean
bypassUpdates | If "true", after process validations phase it skips updates of model beans on a force render response. It can be used for validating components input
clientErrorMessage | An error message to use in client-side validation events
data | Serialized (on default with JSON) data passed on the client by a developer on AJAX request. It's accessible via "data.foo" syntax
endRange | A slider end point
eventsQueue | Name of requests queue to avoid send next request before complete other from same event. Can be used to reduce number of requests of frequently events (key press, mouse move etc.)
fieldStyleClass | Assigns one or more space-separated CSS class names to the component input field. The value of the "manualInput" attribute must be "true".
filterBy | A getter of an object member required to compare a slider value to. This is a value that is used in results filtering
focus | ID of an element to set focus after request is completed on client side
for | The component using UIData (datatable id)
forValRef | This is a string which is used in a value attribute of the datatable. It is used for resetting the datatable back to the original list provided by a backing bean
handleStyleClass | Assigns one or more space-separated CSS class names to the component handle
handleValue | Current handle value
id | JSF: Every component may have a unique id that is automatically created if omitted
ignoreDupResponses | Attribute allows to ignore an Ajax Response produced by a request if the newest 'similar' request is in a queue already. ignoreDupResponses="true" does not cancel the request while it is processed on the server, but just allows to avoid unnecessary updates on the client side if the response isn't actual now
immediate | True means, that the default ActionListener should be executed immediately (i.e. during Apply Request Values phase of the request processing lifecycle), rather than waiting until the Invoke Application phase
increment | Amount to which a handle on each slide/move should be incremented
limitToList | If "true", then of all AJAX-rendered on the page components only those will be updated, which ID's are passed to the "reRender" attribute of the describable component. "false"-the default value-means that all components with ajaxRendered="true" will be updated.
manualInput | False value for this attribute makes text field "read-only" and "hidden". Hence, the value can be changed only from a handle. Default value is "true"
onbeforedomupdate | The client-side script method to be called before DOM is updated
onchange | DHTML: The client-side script method to be called when the component input field value is changed
onclick | DHTML: The client-side script method to be called when the element is clicked
oncomplete | The client-side script method to be called after the request is completed
ondblclick | DHTML: The client-side script method to be called when the element is double-clicked
onerror | The client-side script method to be called whenever a JavaScript error occurs
oninputkeydown | The client-side script method to be called when a key is pressed down in the component input field
oninputkeypress | The client-side script method to be called when a key is pressed and released in the component input field
oninputkeyup | The client-side script method to be called when a key is released in the component input field
onkeydown | DHTML: The client-side script method to be called when a key is pressed down over the element
onkeypress | DHTML: The client-side script method to be called when a key is pressed over the element and released
onkeyup | DHTML: The client-side script method to be called when a key is released
onmousedown | DHTML: The client-side script method to be called when a mouse button is pressed down over the element
onmousemove | DHTML: The client-side script method to be called when a pointer is moved within the element
onmouseout | DHTML: The client-side script method to be called when a pointer is moved away from the element
onmouseover | DHTML: The client-side script method to be called when a pointer is moved onto the element
onmouseup | DHTML: The client-side script method to be called when a mouse button is released
onslide | The client-side script method to be called when a slider handle is moved
onSlideSubmit | DEPRECATED (use submitOnSlide). If the slider value is changed, the form is submitted. Default value is "true".
process | Id['s] (in format of call UIComponent.findComponent()) of components, processed at the phases 2-5 in case of AjaxRequest caused by this component. Can be single id, comma-separated list of Id's, or EL Expression with array or Collection
rangeStyleClass | Assigns one or more space-separated CSS class names to the background div element wrapping a full range
rendered | JSF: If "false", this component is not rendered
requestDelay | Attribute defines the time (in ms.) that the request will be wait in the queue before it is ready to send. When the delay time is over, the request will be sent to the server or removed if the newest 'similar' request is in a queue already
reRender | Id['s] (in format of call UIComponent.findComponent()) of components, rendered in case of AjaxRequest caused by this component. Can be single id, comma-separated list of Id's, or EL Expression with array or Collection
similarityGroupingId | If there are any component requests with identical IDs then these requests will be grouped.
sliderListener | MethodBinding representing an action listener method that will be notified after changing of slider control position
startRange | A slider begin point
status | ID (in format of call UIComponent.findComponent()) of Request status component
storeResults | Specifies if the component will store a UIData object (your table rows) in session
style | HTML: CSS style rules to be applied to the component
styleClass | JSF: Assigns one or more space-separated CSS class names to the container surrounding the component. Corresponds to the HTML "class" attribute.
submitOnSlide | If the slider value is changed, the form is submitted. Default value is "true".
timeout | Response waiting time on a particular request. If a response is not received during this time, the request is aborted
trackStyleClass | Assigns one or more space-separated CSS class names to the component track
trailer | It shows or hides a trailer following a handle
trailerStyleClass | Assigns one or more space-separated CSS class names to the trailer following the component handle
value | JSF: The current value for this component
width | HTML: Width of the slider control. Default value is "200px".

Table 6.67. Component identification parameters

Name | Value
--- | ---
component-type | org.richfaces.dataFilterSlider
component-class | org.richfaces.component.html.HtmlDataFilterSlider
component-family | org.richfaces.DataFilterSlider
renderer-type | org.richfaces.DataFilterSliderRenderer
tag-class | org.richfaces.taglib.dataFilterSliderTag

#### 6.6.5.3. Creating the Component with a Page Tag

Here is a simple example as it could be used on a page:

Example:

    ...

    <rich:dataFilterSlider sliderListener="#{mybean.doSlide}" startRange="0"

                                                endRange="50000" increment="10000" handleValue="1" />

    ...

#### 6.6.5.4. Creating the Component Dynamically Using Java

Example:

    import org.richfaces.component.html.HtmlDataFilterSlider;

    ...

    HtmlDataFilterSlider mySlider = new HtmlDataFilterSlider();

    ...

#### 6.6.5.5. Details of Usage

The dataFilterSlider component is bound to some UIData component using a "for" attribute and filters data in a table.

Example:

    ...

    <rich:dataFilterSlider sliderListener="#{mybean.doSlide}"

                            startRange="0"

                            endRange="50000"

                            increment="10000"

                            handleValue="1"

                            for="carIndex"

                            forValRef="inventoryList.carInventory"

                            filterBy="getMileage" />

    ...

    <h:dataTable id="carIndex">

            ...

    </h:dataTable>

    ...

In this example other two attributes are used for filtering:

- "forValRef" is a string which is used in a value attribute of the target UIData component. It's designed for resetting the UIData component back to the original list provided by a backing bean.

- "filterBy" is a getter of an object member that is to be compared to a slider value. It's a value that is used in results filtering.

"handleValue" is an attribute for keeping the current handle position on the dataFilterSlider component. Based on the current value, appropriate values obtained from a getter method defined in "filterBy" are filtered.

One more important attribute is a "storeResults" one that allows the dataFilterSlider component to keep UIData target object in session.

If it's necessary the component submits a form on event of a handle state changing, use the "submitOnSlide" attribute. When the attribute definition is `"true"`, submission on this event is defined.

Information about the "process" attribute usage you can find in the "Decide what to process " guide section.

#### 6.6.5.6. Look-and-Feel Customization

The <rich:dataFilterSlider> component has no skin parameters and special style classes , as it consists of one element generated with a your method on the server. To define some style properties such as an indent or a border, it's possible to use "style" and "styleClass" attributes on the component.

#### 6.6.5.7. Relevant Resources Links

On the component LiveDemo page you can see the example of <rich:dataFilterSlider> usage and sources for the given example.

- Prev6.6.4. < rich:dataDefinitionList > ...
- Top of page
- Front page
- Next6.6.6. < rich:dataGrid > ...