Project Documentation

Summary

Tag name: <tr:selectRangeChoiceBar>
UIComponent class: org.apache.myfaces.trinidad.component.core.data.CoreSelectRangeChoiceBar
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.

Appearance

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

Events

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}" />
  </f:facet>
</tr:selectRangeChoiceBar>

Supported Client Events for Client Behaviors

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

Events

Type Phases Description
org.apache.myfaces.trinidad.event.RangeChangeEventAny Phase,
Invoke Application
The range change event is delivered when the user navigates.
org.apache.myfaces.trinidad.event.AttributeChangeEventInvoke 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
rangeLabeluse to customize the label of each range selection.

Attributes

Name Type Supports EL? Description
attributeChangeListenerjavax.el.MethodExpressionOnly 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.
bindingorg.apache.myfaces.trinidad.component.core.data.CoreSelectRangeChoiceBarOnly 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.
firstintYes 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.
idStringNo the identifier for the component. The identifier must follow a subset of the syntax allowed in HTML:
  • Must not be a zero-length String.
  • First character must be an ASCII letter (A-Za-z) or an underscore ('_').
  • Subsequent characters must be an ASCII letter or digit (A-Za-z0-9), an underscore ('_'), or a dash ('-').
immediatebooleanYes 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.
inlineStyleStringYes the CSS styles to use for this component.
onclickStringYes an onclick Javascript handler.
ondblclickStringYes an ondblclick Javascript handler.
onkeydownStringYes an onkeydown Javascript handler.
onkeypressStringYes an onkeypress Javascript handler.
onkeyupStringYes an onkeyup Javascript handler.
onmousedownStringYes an onmousedown Javascript handler.
onmousemoveStringYes an onmousemove Javascript handler.
onmouseoutStringYes an onmouseout Javascript handler.
onmouseoverStringYes an onmouseover Javascript handler.
onmouseupStringYes an onmouseup Javascript handler.
partialTriggersString[]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".

rangeChangeListenerjavax.el.MethodExpressionOnly EL a method reference to a rangeChange listener that will be called when a new range is selected.
renderedbooleanYes 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.
rowsintYes 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.
shortDescStringYes The short description of the component. This text is commonly used by user agents to display tooltip help text.
styleClassStringYes a CSS style class to use for this component.
valueObjectYes 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.
varStringNo 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.