Summary

Tag Name:<af:column>
Java Class:oracle.adf.view.rich.component.rich.data.RichColumn
Component Type:oracle.adf.RichColumn
Required Ancestor Tag(s): af:column, af:table, af:treeTable
The immediate children of a Table component must all be <af:column> components. Each visible Column component creates a separate column in the Table. Use "headerText" attribute or the "header" facet on a Column to create the column header. The following example creates a two-column table with the column headers - "Firstname" and "Lastname":
  <af:table>
    <af:column>
      <f:facet name="header">
        <af:outputText value="Firstname"/>
      </f:facet>
      ...
    </af:column>
    <af:column>
      <f:facet name="header">
        <af:outputText value="Lastname"/>
      </f:facet>
      ...
    </af:column>
  </af:table>
          
The child components of each Column display the data for each row in that column. The Column does not create child components per row; instead, each child is repeatedly rendered (stamped) once per row. Because of this stamping behavior, only certain types of components are supported as children inside a Column. Supported components include all components with no behavior and most components that implement the EditableValueHolder or ActionSource interfaces. As each row is stamped, the data for the current row ( see getRowData() on the Table) is copied into an EL reachable property. The name of this property is defined by the var property on the Table. Once the Table has completed rendering, this property is removed (or reverted back to its previous value). In the following example, the data for each row is placed under the EL property "row". Each Column displays the data for each row by getting further properties from the "row" property:
  <af:table var="row" value="#{myBean.employees}">
    <af:column>
      <af:outputText value="#{row.firstname}"/>
    </af:column>
    <af:column>
      <af:outputText value="#{row.lastname}"/>
    </af:column>
  </af:table>
          
shortDesc attribute is currently not supported for the <af:column> component. Tooltips are automatically displayed for header and data cells if noWrap is turned off and data in the cell is truncated.

Sorting

In order to make a Column sortable, set the "sortable" property to true and set "sortProperty" to the name of the model that this column will sort. Sorting can be programmatically turned on with the setSortCritiera() method on the table.

Column Group

<af:column> tags can be nested to produce groups of columns. The header of a column group spans across all the columns it contains. The following example creates a column group that has the header "Name" and contains two sub columns with headers "First" and "Last":
  <af:table var="row" value="#{myBean.employees}">
    <af:column headerText="Name">
      <af:column headerText="First">
        <af:outputText value="#{row.firstname}"/>
      </af:column>
      <af:column headerText="Last">
        <af:outputText value="#{row.lastname}"/>
      </af:column>
    </af:column>
  </af:table>
          

Styling

The data cells in the table rendered by<af:column> tags can be styled by using styleClass and inlineStyle attributes. The column header cells can be styled using headerClass attribute. Please note that changing padding and border settings through these attributes is very dangerous. We calculate widths on the server side and expect padding and border attributes to be specified as skinning properties. If they get overridden, the aligment of the table cells might be messed up.

Geometry Management

  • This component can only be placed in a tree or treeTable and the dimensions of a column are controlled by either the columnStretching attribute of that parent component or by the width and minimumWidth attributes of the column.
  • This component does not have support for stretching its children.

Code Example(s)

<af:table rowSelection="multiple" 
          columnSelection="multiple" 
          columnStretching="last"
          var="row" 
          value="#{periodicTable.tableData}"  
          summary="table data" 
          id="t1">
   <af:column headerText="Element Name" sortable="true" id="column1">
      <af:outputText value="#{row.name}" id="ot1"/>
   </af:column>
</af:table>

Accessibility Guideline(s)

  • column header: A column should have a value assigned to either the headerText attribute or the header facet.
  • child input components: For a child input component, you should set simple to "true" and make sure that the input component has a label assigned. The column header should contain a description of the input component. In rich mode the input component's label will not be displayed and the meaning of the input component is derived from the column header. In screen reader mode the label will be read by AT software, appended with the current row number. Columns containing input components should not be set as row headers.
  • Note that empty decorative columns are not rendered in screenReader mode.
  • helpTopicId attribute: Help information should be provided using the helpTopicId.
    • It is preferred to use helpTopicId instead of shortDesc to provide help information.
  • rowHeader attribute: At least one column in a table should be identified as the rowHeader column by setting the rowHeader value to "true" or "unstyled".
  • rowHeader attribute: A table that has row selection enabled must have at least one column identified as a rowHeader column by setting the rowHeader value to "true".
  • rowHeader attribute: The rowHeader column (or the combination of multiple rowHeader columns) should provide a unique value. This way each row has its own unique row header text.
  • rowHeader attribute: RowHeader column content needs to evaluate to a simple textual value. Acceptable content includes outputText, outputFormatted, and any other simple component that evaluates to text (like links). Note that columns containing input components cannot be assigned as a row header as they do not evaluate to a simple textual value.
  • filter facet: If you use a filter facet to set a filter on a column, make sure the filter component has a label assigned.

Supported Client Events for Client Behaviors

  • propertyChange (default)

Events

Type Phases Description
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
context Allowed Child Components: af:contextInfo

Location for contextual information. A contextInfo component is expected. This facet is stamped in each cell of the column.
filterthe node to use to render this column's filter. Table filter fields can be completely model driven. Application developers will be able to use the filterable="true" and "sortProperty" attributes along with "filterModel" to automatically get the filtering support. However if an application developer wants to override the default functionality, they can use the "filter" facet in addition to setting filterable="true" attribute. When doing this, the application developer should also set the alternate filter's label attribute with a helpful label for accessibility mode compatability. For example, for a filter facet set to an inputDate component representing an employee's join date, you could set the inputDate label="Filter: Join Date". Please note that use of varstatus ("vs") property to map values from filterCriteria is deprecated since the completely model driven approach provides similar functionality. For overridding the default functionality from the model see the sample snipped below
footerthe node to render as this column's footer.
headerthe node to use to render this column's header.

Attributes

Name Type Supports EL? Description
alignStringYes Valid Values: start, end, center, left, right

The alignment for this column. "start", "end" and "center" are used for left-justified, right-justified, and center-justified respectively in LTR display. "left" or "right" can be used when left-justified or right-justified cells are needed irrespective of the LTR or RTL display. The default value is null, which implies that it is skin dependent and may vary for the row header column vs data column.
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.
bindingoracle.adf.view.rich.component.rich.data.RichColumnOnly 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.
clientComponentbooleanYes Default Value: false

whether a client-side component will be generated. A component may be generated whether or not this flag is set, but if client Javascript requires the component object, this must be set to true to guarantee the component's presence. Client component objects that are generated today by default may not be present in the future; setting this flag is the only way to guarantee a component's presence, and clients cannot rely on implicit behavior. However, there is a performance cost to setting this flag, so clients should avoid turning on client components unless absolutely necessary.
colSpanStringYes Default Value: 1

the number of columns a cell should span. Default is 1. If set to "ALL", the column spans all the cell toward the end.
Not supported on the following renderkits: org.apache.myfaces.trinidad.core
customizationIdStringYes This attribute is deprecated. This attribute will be removed in the next release. Use the 'id' attribute instead.

This attribute is deprecated. The 'id' attribute should be used when applying persistent customizations. This attribute will be removed in the next release.
displayIndexintYes Default Value: -1

The display order index of the column. Columns can be re-arranged and they are displayed in the table based on the displayIndex. Columns are sorted based on the displayIndex property, columns without displayIndex are displayed at the end, in the order in which they appear. The displayIndex attribute is honored only for top level columns, since it is not possible to rearrange a child column outside of the parent column.
Not supported on the following renderkits: org.apache.myfaces.trinidad.core
dontPersistString[]Yes a list of attributes whose changes are NOT to be persisted by FilteredPersistenceChangeManager via the "Persistent Change Manager" registered in adf-config.xml. The token 'ALL' can be used in the list here to indicate that all attribute changes that the component implicitly persists should be excluded. If there is a conflict of values, "dontPersist" always precedes "persist".
filterFeaturesjava.util.SetYes The filter features for this column. A set of flags which specify how this column should be filtered in query-by-example (QBE). Currently the only values supported are: "caseSensitive" and "caseInsensitive". If not specified, the case sensitivity is model-dependent. The features are hints for a collection model, which supports filtering, to perform special filtering operations (such as case-sensitive/insensitive filtering)
filterablebooleanYes Default Value: false

whether or not the column is filterable. A filterable column will have a filter field on the top of the column header. Note that in order for a column to be filterable, this attribute must be set to "true" and the filterModel attribute will be set on the table. Only Leaf columns are filterable and the filter component is displayed only if the column header is present. The column header is present if the "headerText" attribute or "header" facet is set on the column.

This column's "sortProperty" attribute will be used as a key for the filterProperty in the filterModel. This implies that "sortProperty" *must* be set on the column for it to be filterable.

Also look at "filter" facet for providing a component other than the default inputText for filtering.

footerClassStringYes a CSS style class to use for the column footer. The headerClass, footerClass and the styleClass attributes on the column should be used with caution. Changing the horizontal padding/borders of the header, footer and data cells will mess up alignment of the table cells.
frozenbooleanYes Default Value: false

Specifies whether the column is frozen. In the table columns until the frozen column are locked with the header and not scrolled with the rest of the columns. Frozen attribute is honored only on the top level column,since it is not possible to freeze a child column by itself without its parent being frozen. If the table has a detailStamp for its rows, column freezing is turned off.
Not supported on the following renderkits: org.apache.myfaces.trinidad.core
headerClassStringYes a CSS style class to use for the column header. The headerClass, footerClass and the styleClass attributes on the column should be used with caution. Changing the horizontal padding/borders of the header, footer and data cells will mess up alignment of the table cells.
headerNoWrapbooleanYes Default Value: false

whether or not the column header should be allowed to wrap
Not supported on the following renderkits: oracle.adf.rich
headerTextStringYes text to display in the header of the column. This is a convenience that generates output equivalent to adding a "header" facet containing an outputText. If a "header" facet is added, headerText will not be rendered in column header.
helpTopicIdStringYes Id used to look up a topic in a helpProvider.
idStringNo 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).
inlineStyleStringYes the CSS styles to use for this component. This is intended for basic style changes. The inlineStyle is a set of CSS styles that are applied to the root DOM element of the component. Be aware that because of browser CSS precedence rules, CSS rendered on a DOM element takes precedence over external stylesheets like the skin file. Therefore skins will not be able to override what you set on this attribute. If the inlineStyle's CSS properties do not affect the DOM element you want affected, then you will have to create a skin and use the skinning keys which are meant to target particular DOM elements, like ::label or ::icon-style.
minimumWidthStringYes Default Value: 12

The minimum number of pixels that the column can become. When a user attempts to resize the column, this minimum width will be enforced. Also, when a column is flexible, it will also never be stretched to be a size smaller than this minimum width. If a pixel width is defined and if the minimum width is larger, the minimum width will become the smaller of the two values. By default, the minimum width is 12 pixels.
Not supported on the following renderkits: org.apache.myfaces.trinidad.core
noWrapbooleanYes Default Value: true

Specifies whether whitespace wrapping should be allowed in this column.
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. Identifiers are relative to the source component (this component), and must account for NamingContainers. If your component is already inside of a naming container, you can use a single colon to start the search from the root of the page, or multiple colons to move up through the NamingContainers - "::" will pop out of the component's naming container (or itself if the component is a naming container) and begin the search from there, ":::" will pop out of two naming containers (including itself if the component is a naming container) and begin the search from there, etc.
persistString[]Yes a list of attributes whose changes are to be persisted by FilteredPersistenceChangeManager via the "Persistent Change Manager" registered in adf-config.xml. The token 'ALL' can be used in the list here to indicate that all attribute changes that the component implicitly persists should be included.
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.
rowHeaderStringYes Valid Values: true, false, unstyled
Default Value: false

Whether or not this column is considered a row header column for the table. Valid values are "true", "false", and "unstyled". The default value is "false" and results in no special handling. A column that is marked as rowHeader "true" is moved to the starting position (displayIndex = 0) and is automatically frozen. A value of "unstyled" indicates that the column is a row header for screen reader mode purposes, but there are no visual changes done to the column in rich mode. A value of "unstyled" is typically used when you want to indicate a row header for accessibility requirements, but don't want any visual changes made to your column or table in regular rich mode.

In screen reader mode, when the rowHeader is set to "true" or "unstyled" the column is marked as a row header and moved to the starting position. It is required for accessibility that at least one column to be marked as a row header and that the rowHeader provides unique textual information.

Also note that for a table with row selection enabled, at least one column in the table will need to be set as a row header with rowHeader=true. This is needed to allow keyboard row selection.

selectedbooleanYes Default Value: false

Specifies whether the column is selected.
Not supported on the following renderkits: org.apache.myfaces.trinidad.core
showRequiredbooleanYes Default Value: false

Indicates whether the columns displays a visual indication of required user input.
sortPropertyStringYes The property that is displayed by this Column. This is the property that the framework might use to (for example) sort the Table's data.
sortStrengthStringYes Valid Values: Primary, Secondary, Tertiary, Identical
Default Value: Identical

The sorting strength for this column. It controls how this column should be sorted, what level of difference considered significant during comparison. Currently the values supported are: "Primary", "Secondary", "Tertiary" and "Identical". Default value is "Identical".
sortablebooleanYes Default Value: false

whether or not the column is sortable. A sortable column has a clickable header that (when clicked) sorts the table by that column's property. Note that in order for a column to be sortable, this attribute must be set to "true" and the underlying model must support sorting by this column's property.

This column's "sortProperty" attribute must be set if sorting is desired.

styleClassStringYes a CSS style class to use for this component. The style class can be defined in your jspx page or in a skinning CSS file, for example, or you can use one of our public style classes, like 'AFInstructionText'.
visiblebooleanYes Default Value: true

the visibility of the column. If it is "false", the column will not be displayed in the table on the client. Unlike "rendered", this does affect the lifecycle on the server - the column may have its bindings executed, etc. When "rendered" is false, the component will not in any way be rendered, and cannot be made visible on the client.
Not supported on the following renderkits: org.apache.myfaces.trinidad.core
widthStringYes Default Value: 100

The width of the column. The default width for a column is 100px. There is no auto sizing for columns. Set the width attribute to ensure the column is wide enough to accommodate the width of the contents. When the "multiple" option is used in the table that contains the column, the width can be set to a percentage. Non-group column widths as percentages will be honored. When widths using percentages exist and the table columnStretching is set to "multiple", the percentages are used to determine a normalized ratio. For example, if two columns have their widths set to "100%", they will each be normalized to take up .5 times the stretchable space. Stretchable space is defined as the space after px widths are taken into account. Minimum widths are honored by the stretching.