Oracle ADF Faces - <af:column>

Summary

Tag name: <af: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>
          

Sorting

In order to make this 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 Groups

<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":

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.

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.

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

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 events might include the width of a column that supported client-side resizing.

Supported Facets

Name Description
filter the node to use to render this column's filter.
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 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 The id used to locate this component when applying persistent customizations. Components without a customizationId set can not save customizations to the persistent store. Instead, any customizations will at most only apply to the current Session. Each customizationId must be unique in the document.
displayIndex int Yes 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 List of persistent attributes that are restricted from persisting to a registered "Persistent Change Manager". Persistent attributes would still persist to a session.
filterable boolean Yes whether or not the column is filterable. A filterable column shall 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 shall be set on the table. Only Leaf columns are filterable and the filter component is displayed only if the column header is present.

This column's "sortProperty" attribute shall be used as a key for the filterProperty in the filterModel.

frozen boolean Yes 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 and the styleClass attributes on the column should be used with caution. Changing the horizontal padding/borders of the header and data cells will mess up alignment of the table cells.
headerNoWrap boolean Yes 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. 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 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 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, 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, or multiple colons to move up through the NamingContainers - "::" will search from the parent naming container, ":::" will search from the grandparent naming container, etc.
persist String[] Yes List of persistent attributes that are persisting to a registered "Persistent Change Manager". Persistent attributes, by default, always persist to a session.
rendered boolean Yes whether the component is rendered. When set to false, no output will be delivered for this component.
rowHeader boolean Yes Whether or not this column is a row header column.
selected boolean Yes Specifies whether the column is selected.
Not supported on the following renderkits: org.apache.myfaces.trinidad.core
separateRows boolean Yes whether or not the children of this column should be rendered on separate rows. Setting this attribute to true will cause each child to render in its own row. Setting this to false will cause all the children to be rendered in one cell, which will rowSpan across the rows of the Columns whose children are rendered on separate rows.
Not supported on the following renderkits: oracle.adf.rich
shortDesc String Yes the short description of the component. This text is commonly used by user agents to display tooltip help text. For form components, this is displayed in the note window.
showRequired boolean Yes 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 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.
visible boolean Yes the visibility of the component. If it is "false", the component will be hidden on the client. Unlike "rendered", this does not affect the lifecycle on the server - the component may have its bindings executed, etc. - and the visibility of the component can be toggled on and off on the client, or toggled with PPR. 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 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.

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy