Documentation

Search 

Contents

  1. Introduction
  2. Getting Started
  3. ICEfaces Concepts
  4. Code View Support
  5. Design View Support
  6. Tag Object Toolbars
  7. Server Behaviors
  8. Property Inspectors
Selected 9. ICEfaces Tag Reference

10. ICEfaces Tag Reference

Contents > ICEfaces Tag Reference > ice:commandSortHeader

ice:commandSortHeader

The ice:commandSortHeader tag can be used to provide a user-controlled data sorting capability to a dataTable.

The commandSortHeader renders a clickable column header facet allowing the user to toggle the sort order of data in the table, either ascending or descending based on the values in the column.

Example

<ice:dataTable var="car" value="#{backingBean.sortedCarList}" width="500">
  <ice:column>
    <f:facet name="header">
      <ice:commandSortHeader columnName="Make" styleClass="make" arrow="true">
        <ice:outputText value="Make" />
      </ice:commandSortHeader>
    </f:facet>
    <ice:outputText value="#{car.make}" />
  </ice:column>
  <ice:column>
    <f:facet name="header">
      <ice:commandSortHeader columnName="Model" disabled="true" arrow="true">
        <ice:outputText value="Model" />
      </ice:commandSortHeader>
    </f:facet>
    <ice:outputText value="#{car.model}" />
  </ice:column>
  <ice:column>
    <f:facet name="header">
      <ice:commandSortHeader columnName="Color" arrow="true">
        <ice:outputText value="Color" />
      </ice:commandSortHeader>
    </f:facet>
    <ice:outputText value="#{car.color}" />
  </ice:column>
  <ice:column>
    <f:facet name="header">
      <ice:outputText value="Year" />
    </f:facet>
    <ice:outputText value="#{car.year}" />
  </ice:column>
</ice:dataTable>

Rendered Output

Rendered ice:commandSortHeader tag

Tag Attributes

action Text
 
The action attribute accepts a method-binding expression for a backing bean action method to invoke when this component is activated by the user. An action method must be a public method with no parameters that returns a String. The returned string represents the logical outcome of the action (eg. "success", "failure", etc.) and is used by the JavaServer Faces MVC framework to determine which view to display next.
actionListener Text
 
The actionListener attribute accepts a method-binding expression for a backing bean action listener method that will be notified when this component is activated by the user. An action listener method must be a public method with an javax.faces.event.ActionEvent parameter and a void return type.
arrow Boolean
 
The arrow attribute is a boolean flag the when set to "true" displays an arrow that indicates the sort direction. The default value is "false".
binding Expression
 
The value-binding expression linking this component tag to a backing bean property.
columnName Text
 
The columnName attribute sets the name of this column. This name must uniquely identify this column among all other (sortable) columns in the same data table. The sortColumn attribute of the embedding data table reflects the current sort column (see extended data table).
disabled Boolean
 
The disabled attribute is a boolean flag that when set to true indicates that this component should not receive focus or be included in a form submit.
enabledOnUserRole Text
 
The enabledOnUserRole attribute is a boolean flag that when set to "true" and if a role has been configured for the user, then the component will be displayed and will function. If the user does not have a role, then the component will be disabled (will not function) and will be grayed out.
id Text
 
The unique identifier value for this component. The value must be unique within the closest naming container.
immediate Boolean
 
The immediate attribute is a boolean flag indicating that component events should be sent to registered event listeners immediately rather than after the validation phase of the JSF request processing lifecycle. The immediate flag allows you bypass JSF validation for a particular component.
rendered Boolean
 
A value-binding expression that evaluates to a Boolean condition indicating if this component should be rendered.
renderedOnUserRole Text
 
The renderedOnUserRole attribute is a boolean flag that when set to "true" and if a role has been configured for the user, then the component will be displayed. If the user does not have a role, then the component will not be displayed.
styleClass CSS Class
 
The styleClass attribute sets the CSS class to apply to this component when it is rendered. Default value is iceCmdSrtHdr if enabled and iceCmdSrtHdr-dis if disabled.
value Text
 
The value attribute sets the current value for this component.