Oracle Fusion Middleware Tag Reference for Oracle ADF Faces
11g Release 2 (11.1.2.2.0)

E17491-04

<af:column>

af:column column column

UIComponent class: oracle.adf.view.rich.component.rich.data.RichColumn
Component type: oracle.adf.RichColumn

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 programatically 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

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>
   

Events

Type Phases Description
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
context Location for contextual information. A contextInfo component is expected. This facet is stamped in each cell of the column.
filter the node to use to render this column's filter. In most cases application developers will be able to use the filterable="true" and "sortProperty" attributes along with "filterModel" to automatically get the filter support through "inputText" components. However if an application developer wants to support a component other than "inputText", 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". Requirements for filtering based on dates can be met through this facet. A property "filterCriteria" will be available on the table "varStatus" attribute when the filter facet is processed. This property will return a map of filter-property/filterCriteria (name/value pairs). Components inside the filter facet can be bound to this attribute to access the filter criteria.
footer the node to render as this column's footer.
header the node to use to render this column's header.

Attributes

Name Type Supports EL? Description
align String Yes 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.
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 oracle.adf.view.rich.component.rich.data.RichColumn 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.
clientComponent boolean Yes 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.
customizationId String Yes This attribute is deprecated. The 'id' attribute should be used when applying persistent customizations. This attribute will be removed in the next release.
displayIndex int Yes 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
dontPersist String[] 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".
filterFeatures java.util.Set Yes 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)
filterable boolean Yes 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.

footerClass String Yes 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.
frozen boolean Yes 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
headerClass String Yes 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.
headerNoWrap boolean Yes Default Value: false

whether or not the column header should be allowed to wrap
Not supported on the following renderkits: oracle.adf.rich
headerText String Yes 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.
helpTopicId String Yes Id used to look up a topic in a helpProvider.
id String No 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 ('-').
inlineStyle String Yes 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.
minimumWidth String Yes 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
noWrap boolean Yes Default Value: true

Specifies whether whitespace wrapping should be allowed in this column.
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. 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.
persist String[] 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.
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.
rowHeader String Yes 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.

selected boolean Yes Default Value: false

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

This property is currently not supported in the rich client.
Not supported on the following renderkits: oracle.adf.rich
shortDesc String Yes This will display a small popup on the screen. Use the helpTopicId instead of this field.
Not supported on the following renderkits: oracle.adf.rich
showRequired boolean Yes Default Value: false

Indicates whether the columns displays a visual indication of required user input.
sortProperty String Yes 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.
sortable boolean Yes 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.

styleClass String Yes 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'.
visible boolean Yes 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
width String Yes 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.