Keywords: rich:dataFilterSlider

JBoss.org Community Documentation

- Prev
- Next

## 6.28. < rich:dataFilterSlider >

### 6.28.1. Description

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

Figure 6.28. <rich:dataFilterSlider> component

### 6.28.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.107. 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 | boolean attribute which provides possibility to limit JSF tree processing(decoding, conversion/validation, value applying) to the component which send the request only
binding | 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 | The styleClass for input that displays the value : 'manualInput' 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 element to set focus after request 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 | The handleStyleClass for a handle
handleValue | Current handle value
id | 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", updates on client side ONLY elements from this 'reRender' property. If "false" (default) updates all rendered by ajax region components
manualInput | False value for this attribute makes text field "read-only" and "hidden". Hence, the value can be changed only from a handle
onbeforedomupdate | JavaScript code for call before DOM has been updated on client side
onchange | Event occur on chage
onclick | HTML: a script expression; a pointer button is clicked
oncomplete | JavaScript code for call after request completed on client side
ondblclick | HTML: a script expression; a pointer button is double-clicked
onerror | HTML: a script expression; event fires whenever an JavaScript error occurs
onkeydown | HTML: a script expression; a key is pressed down
onkeypress | HTML: a script expression; a key is pressed and released
onkeyup | HTML: a script expression; a key is released
onmousedown | HTML: script expression; a pointer button is pressed down
onmousemove | HTML: a script expression; a pointer is moved within
onmouseout | HTML: a script expression; a pointer is moved away
onmouseover | HTML: a script expression; a pointer is moved onto
onmouseup | HTML: script expression; a pointer button is released
onslide | Event occur on sliding
onSlideSubmit | DEPRECATED (use submitOnSlide). If the slider value changes must submit a form. 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 | The rangeStyleClass for the background div showing a full range
rendered | 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
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 | CSS style(s) is/are to be applied when this component is rendered
styleClass | The styleClass for the container div surrounding the component
submitOnSlide | If the slider value changes must submit a form. 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 | The trackStyleClass for a background div
trailer | It shows or hides a trailer following a handle
trailerStyleClass | The trailerStyleClass for a div following a handle
value | The current value for this component
width | Width of the slider control. Default value is "200px".

Table 6.108. 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.28.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.28.4. Creating the Component Dynamically Using Java

Example:

    import org.richfaces.component.html.HtmlDataFilterSlider;

    ...

    HtmlDataFilterSlider mySlider = new HtmlDataFilterSlider();

    ...

### 6.28.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 handler 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 handler state changing, use the "onSlide" attribute ( "onChange" is its alias). When the attribute definition = true, submission on this event is defined.

Information about the "process" attribute usage you can find here.

### 6.28.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.28.7. Relevant Resources Links

Here you can see the example of <rich:dataFilterSlider> usage and sources for the given example.

- Prev6.27. < rich:contextMenu >
- Top of page
- Front page
- Next6.29. < rich:datascroller >