Parent Project
Project Documentation


Tag Name: <tr:selectRangeChoiceBar>
Java Class:
Component Type: org.apache.myfaces.trinidad.CoreSelectRangeChoiceBar
SelectRangeChoiceBar is used to allow the user to select a range of records to display among a larger set of records. It allows the user to move back and forth through these records.


selectRangeChoiceBar renders a Previous button, a choice, and a Next button. The choice contains options for ranges.


Clicking on either the Previous or Next buttons or selecting an option from the choice will deliver a RangeChangeEvent to the server.

Code Example(s)

The following is an example of selectRangeChoiceBar. If tableData has 100 rows, it renders a Previous button, a choice with the selected value of 30-39 of 100, and a Next button.

<tr:selectRangeChoiceBar value="#{tableData}" first="30" rows="10"/>

The following is an example of selectRangeChoiceBar with customized range labels.

<tr:selectRangeChoiceBar value="#{tableData}" var="range" first="30" rows="10">
  <f:facet name="rangeLabel">
    <f:selectItem itemLabel="#{range.start.eName} - #{range.end.eName}" />

Supported Client Events for Client Behaviors

  • blur
  • change (default)
  • click
  • dblclick
  • focus
  • keydown
  • keypress
  • keyup
  • mousedown
  • mousemove
  • mouseout
  • mouseover
  • mouseup


Type Phases Description
org.apache.myfaces.trinidad.event.RangeChangeEvent Any Phase,
Invoke Application
The range change event is delivered when the user navigates.
org.apache.myfaces.trinidad.event.AttributeChangeEvent Invoke Application,
Apply Request Values
Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change event might include the width of a column that supported client-side resizing.

Supported Facets

Name Description
rangeLabel use to customize the label of each range selection.


Name Type Supports EL? Description
attributeChangeListener javax.el.MethodExpression Only EL a method reference to an attribute change listener. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing.
binding Only EL an EL reference that will store the component instance on a bean. This can be used to give programmatic access to a component from a backing bean, or to move creation of the component to a backing bean.
first int Yes Default Value: 0

the index of the first row in the currently range of rows. This index is zero-based. This attribute is used to control which range of rows to display to the user.
id String No the identifier for the component. Every component may be named by a component identifier that must conform to the following rules:
  • They must start with a letter (as defined by the Character.isLetter() method) or underscore ( _ ).
  • Subsequent characters must be letters (as defined by the Character.isLetter() method), digits as defined by the Character.isDigit() method, dashes ( - ), or underscores ( _ ). To minimize the size of responses generated by JavaServer Faces, it is recommended that component identifiers be as short as possible. If a component has been given an identifier, it must be unique in the namespace of the closest ancestor to that component that is a NamingContainer (if any).
immediate boolean Yes Default Value: false

whether data validation should be skipped when range change events are generated by this component. When immediate is false (the default), events will be delivered during the Invoke Application phase, which will trigger validation. When set to true, events will be executed during the Apply Request Values phase.
inlineStyle String Yes the CSS styles to use for this component.
onclick String Yes an onclick Javascript handler.
ondblclick String Yes an ondblclick Javascript handler.
onkeydown String Yes an onkeydown Javascript handler.
onkeypress String Yes an onkeypress Javascript handler.
onkeyup String Yes an onkeyup Javascript handler.
onmousedown String Yes an onmousedown Javascript handler.
onmousemove String Yes an onmousemove Javascript handler.
onmouseout String Yes an onmouseout Javascript handler.
onmouseover String Yes an onmouseover Javascript handler.
onmouseup String Yes an onmouseup Javascript handler.
partialTriggers String[] Yes the IDs of the components that should trigger a partial update.

This component will listen on the trigger components. If one of the trigger components receives an event that will cause it to update in some way, this component will request to be updated too.

Separate multiple triggers with a space. e.g., partialTriggers="cmp1 cmp2"

Identifiers must account for NamingContainers. You can use a single colon to start the search from the root, or use multiple colons to move up through the NamingContainer. For example, "::" will pop out of this component's naming container (it pops out of itself if it is a naming container), ":::" will pop out of two naming containers, etc. The search for the partialTrigger begins from there. e.g., partialTriggers=":::commandButton1" the search begins for the component with id = commandButton1 after popping out of two naming containers relative to this component. To go into naming containers, you separate the naming containers with ':', e.g.,partialTriggers= "nc1:nc2:nc3:componentId".

rangeChangeListener javax.el.MethodExpression Only EL a method reference to a rangeChange listener that will be called when a new range is selected.
rendered boolean Yes Default Value: true

whether the component is rendered. When set to false, no output will be delivered for this component (the component will not in any way be rendered, and cannot be made visible on the client). If you want to change a component's rendered attribute from false to true using PPR, set the partialTrigger attribute of its parent component so the parent refreshes and in turn will render this component.
rows int Yes Default Value: 25

the maximum number of rows to display in a single range of rows. Some ranges might have fewer than the number of rows specified by this attribute (eg: the last range might have an insufficient number of rows). To display all rows at once, set this attribute to 0.
shortDesc String Yes The short description of the component. This text is commonly used by user agents to display tooltip help text.
styleClass String Yes a CSS style class to use for this component.
value Object Yes the data model being used by this component. The specific model class is org.apache.myfaces.trinidad.model.CollectionModel. You may also use other model instances, e.g., java.util.List , array, and javax.faces.model.DataModel. This component will automatically convert the instance into a CollectionModel.
var String No the name of the EL variable that provides access to the "start" and "end" variables that point to the start and end row in the each range from the data model. This can be used to customize the range text.