<dvt:pivotTable>

The Pivot Table supports the display of multiple nested attributes on a row and column header. In addition, the Pivot Table supports the ability to dynamically change the layout of the attributes displayed in the row or column headers via drag and drop pivoting.

Pivot Table Features

Pivot Table Model

The Pivot Table component uses a model to display and interact with data. The specific model class to use is oracle.adf.view.faces.bi.model.pivotTable.PivotTableModel. In order to link a Pivot Table and a Graph to the same set of data, the model class oracle.adf.view.faces.bi.model.DataModel should be used.

var and varStatus

The "var" and "varStatus" attributes are used to access cell data from within the <dvt:dataCell> and <dvt:headerCell> tags. For example:

var

The "var" value ("cellData" in the above example) must be followed by a metadata keyword such as "dataValue". See below for a list of metadata keywords. In the above example, the value of the outputText is set to "#{cellData.dataValue}", which is the value of the current cell.

varStatus

The "varStatus" value ("cellStatus" in the above example) must be followed by "members", "model", "cellIndex", or "cellKey".

The "members" syntax is valid only inside the <dvt:dataCell> tag. It provides access to the header cells corresponding to (in the same row or column as) the current data cell. The brief example above illustrates the syntax: "members" is followed by the name of the layer (e.g. "Product", "Year") containing the desired header cell, which is followed by a header cell metadata keyword such as "dataValue". See below for a list of header cell metadata keywords. See also the formatting example below.

The "model" syntax (e.g. cellStatus.model) returns the DataModel for this component.

The "cellIndex" syntax (e.g. cellStatus.cellIndex) returns the CellIndex of the current cell.

The "cellKey" syntax (e.g. cellStatus.cellKey) returns the CellKey of the current cell.

Metadata keywords for data cells

For rowset data models, the following metadata keywords are supported for data cells (i.e. after the "var" variable inside the <dvt:dataCell> tag). See the code samples for examples of their usage.

Common values

dataValue: The most frequently useful keyword. Returns the data value Object for the current cell. If this object has EL-accessible fields of its own, they can be accessed via "dataValue.fieldName". See the code samples below.

Aggregates and collections

dataCubeMax, dataCubeMin: Return a Number that is the max and min, respectively, for the measure of the cell across the values in the cube. See the Gauge example below.

dataIsTotal: Returns Boolean true if this cell is an aggregate. See the SparkChart example below

dataAggregates: If the cell is an aggregate, returns a List<String, Object> of column/value pairs representing the non-aggregate cells making up the aggregation for the given cell.

aggregateCollection: If the cell is an aggregate, returns the List<String, Object> of column/value pairs in the cube that make up the cell's aggregate value. Note that aggregateCollection is post-cube and dataAggregates is not. See the SparkChart example below.

Advanced values

dataRow: Returns a Map<String, Object> from attribute name to data Object in the original row mapping. Usage: dataRow.foo, where "foo" is one of the rowset attribute (column) names.

dataTypeColumn: Returns a String representing the name of the rowset attribute from which the value comes.

dataRowKey: Returns the row data model's ADFm row key.

dataKeyPath: Returns the ADFm key path object.

Metadata keywords for header cells

For rowset data models, the following values are supported for header cells (i.e. after the "var" variable inside the <dvt:headerCell> tag, and when accessing a header cell from within the <dvt:dataCell> tag via the "members" syntax) :

Common values

dataValue: The most frequently useful keyword. Returns the Object value of the header cell. If this object has EL-accessible fields of its own, they can be accessed via "dataValue.fieldName". See the code samples below.

value: Returns the String value of the header cell. Also available in cubic data models.

label: Returns the String label for the header cell. Also available in cubic data models.

Aggregates, Drilling, and Additional values

isTotal: Returns Boolean true if the header cell represents an aggregate. See the SparkChart example below.

drillState: Returns an Integer value representing the drill state of the current header cell, if applicable. 0 indicates "not drillable", 1 indicates "drillable", and 2 indicates "drilled". Also available in cubic data models.

memberMetadataColumn: Returns the String attribute column of the header cell.

Layer info

layerName: Returns a String representing the name of the layer containing this header cell. See the "Formatting based on header cells" example below.

layerLabel: Returns a String representing the label (if any) for the layer containing this header cell. May fall back to layerName.

Sizing

The inlineStyle attribute can be used to specify a Pivot Table's width and height. For example, inlineStyle="width:600px;height:400px".

Pivot Table supports auto-sizing, which can be used by setting pivot table's attribute sizing="auto". When auto-sizing is set, the height of the pivot table is determined by the size of the content that is being displayed by the pivot table. If the content is smaller than the default size of the pivot table, then the pivot table will shrink. If the content is larger than the default size of the pivot table, the content will grow and pivot table will display scrollbars as needed.
Please note that when sizing="auto", the pivot table's frame will initially be displayed with the default size of the pivot table ( using the width/height CSS attributes ) and then the pivot table's frame will readjust to fit its contents. This can cause the layout of the page displaying the pivot table to change after the page is initially displayed.

a converter, javax.faces.convert.Converter, which is used to perform number/date/text formatting of a cell raw value

a CSS style, which is used to change the CSS style of a cell

a CSS text style, which is used to change the CSS style of a cell's text

a new raw value, which is used to change the cell's underlying value that was returned from the data model

For more detailed description, refer to <dvt:dataCell> component guide

Selection

Selection allows a user to select one or more cells. Pivot table has three different types of selection, i.e. row header selection set, column header selection set, and data selection set. Only one type of selection can be made in pivot table at any one time. An application can implement some features, for example, display a customized content for a context menu, based on the current selected cells.

The code example below shows how to get the currently selected header cells.

Drill

Drill operation is used to hide or unhide hierarchy of the data within pivot table. It is supported when the underlying data source allows this operation. A drill listener will be notified after a drill event is successfully performed. drillEnabled attribute specifies whether drilling is enabled.

Pivot

Pivot operation can be peformed for each data attribute, and it will change the data presentation structure within pivot table. It is supported when the underlying data source allows this operation. A pivot listener will be notified after a pivot event is successfully performed. This operation can be enabled using pivotEnabled property of pivot table.

Sort

Sort operation is used to sort the data within pivot table. It is supported when the underlying data source allows this operation. A sort listener will be notified after a sort event is successfully performed. sortMode attribute specifies if sort operation is enabled, and which type of sort should be used.

Status Bar

Pivot Table provides status bar that will be shown when pivot table's attribute statusBarRendered="true". It provides selection information, i.e. current selection type and number of cells/rows/columns selected.

Geometry Management

This component can be stretched by a parent layout component that stretches its children, e.g. panelStretchLayout, panelSplitter

This component is automatically stretched to fill up the browser's viewport when it is the "sole visual root component" in the component tree and if the document component is configured with maximized="true" (the default).

When NOT stretched, this component will be displayed in its default dimensions which are provided by the skin. This can be modified by applying a dimension using the inlineStyle or styleClass attributes.

This component does not stretch its children. Specifically, the content of the header cell and data cell will not be stretched. The dimension of the header cell and data cell is determined either by the stamped component inside the header and data cell, or by the sizingManager. Please refer to 'sizingManager' attribute for more information.

Accessibility Guideline(s)

summary attribute:The summary property must be specified. The summary should describe the purpose of the component.

Supported Client Events for Client Behaviors

blur

click (default)

contextMenu

dblClick

focus

keyDown

keyPress

keyUp

mouseDown

mouseMove

mouseOut

mouseOver

mouseUp

propertyChange

Child Tags

This component can be the parent of:

<dvt:headerCell> is used to specify non-editable value holder for each header attribute

<dvt:dataCell> is used to specify non-editable as well as editable component type for each data attribute

Events

The drill requesting event is delivered before a drill operation is executed, which allows an application to abort the drill.

oracle.adf.view.faces.bi.event.pivotTable.SortEvent

Invoke Application

The sort event is delivered when the pivot table is sorted.

oracle.adf.view.faces.bi.event.PivotEvent

Invoke Application

The pivot event is delivered when a pivot operation is performed in the pivot table.

oracle.adf.view.faces.bi.event.pivotTable.CellImageClickEvent

Invoke Application

Deprecated. The click event is delivered when a cell image is clicked.

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

bodyContextMenu

the component to use to specify additional controls to appear in the context menu that is shown on right click within the Pivot Table, but outside of any header and data cells. The af:popup must contain an af:menu. As with JSP pages, when using Facelets, multiple components are not allowed in this facet.

contextMenu

the component to use to specify additional controls to appear in the context menu that is shown on right click of any header and data cells. The af:popup must contain an af:menu. As with JSP pages, when using Facelets, multiple components are not allowed in this facet.

Attributes

Name

Type

Supports EL?

Description

activeCellKey

oracle.adf.view.faces.bi.model.CellKey

Yes

This is only applicable in editable Pivot Table. An active cell in Pivot Table will be made editable and is brought into view (if not already visible). Upon initial display, the Pivot Table defaults the active cell to the first visible cell.

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.

autoIndent

int

Yes

Default Value: 5

Specifies how many pixels to indent row labels for each level in a hierarchy. This property specifies the number of pixels to indent each level. The default value is 5.

binding

String

Only EL

binding reference to store the UIPivotTable component

bodyContextMenuId

String

Yes

Deprecated. It will be removed in the next release. 'bodyContextMenu' facet should be used instead. A search expression to identify the popup component containing the context menu that will be shown within the pivot table body, for clicks outside the selectable regions of the pivot table, such as the row header, column header, or data regions. Expressions are relative to this pivot table component and must account for NamingContainers. You can prepend a single colon to start the search from the root, or multiple colons to move up through the NamingContainers. For example, a leading "::" will search from the parent NamingContainer, ":::" will search from the grandparent NamingContainer, etc.

cellImageClickAction

javax.el.MethodExpression

Only EL

Deprecated. It will be removed in the next release. Custom images should be specified via 'dvt:dataCell' with child tag 'af:image', 'af:icon' or 'af:commandImageLink' instead. A method reference to a cell image click action

cellImageClickListener

javax.el.MethodExpression

Only EL

Deprecated. It will be removed in the next release. Custom images should be specified via 'dvt:dataCell' with child tag 'af:image', 'af:icon' or 'af:commandImageLink' instead. A method reference to a cell image click listener that will be called after an image click operation is performed in pivot table

Options are "lazy", "immediate", and "whenAvailble". If "lazy", then the pivot table's content is fetched after the pivot table is sent to the browser. If "immediate", then the pivot table content is immediately sent to the browser. If "whenAvailable", then "immediate" content delivery is used if the data is already available; otherwise "lazy" content delivery is used. The default value is "whenAvailable".

contextMenuId

String

Yes

Deprecated. It will be removed in the next release. 'contextMenu' facet should be used instead. A search expression to identify the popup component containing the context menu that will be shown for clicks within selectable regions of the pivot table, such as the row header, column header, or data regions. Expressions are relative to this pivot table component and must account for NamingContainers. You can prepend a single colon to start the search from the root, or multiple colons to move up through the NamingContainers. For example, a leading "::" will search from the parent NamingContainer, ":::" will search from the grandparent NamingContainer, etc.

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.

dataFormat

javax.el.MethodExpression

Only EL

A MethodExpression that returns a oracle.adf.view.faces.bi.component.pivotTable.CellFormat given a oracle.adf.view.faces.bi.component.pivotTable.DataCellContext. Note if stamps are specified for data cell then the converter and text style set in the CellFormat are completely ignored. Some css style set in the style of CellFormat might work (ex:background-color).

dataFormatManager

oracle.adf.view.faces.bi.component.pivotTable.DataFormatManager

Yes

An instance of oracle.adf.view.faces.bi.component.pivotTable.DataFormatManager. It gives an application the ability to serialize their format rules for a specific pivot table across requests.

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.

drillAction

javax.el.MethodExpression

Only EL

A reference to an action method sent by the component, or the static outcome of a drill action

drillRequestedListener

javax.el.MethodExpression

Only EL

A method reference to a drill requested listener that will be called after a drill operation is performed in pivot table

drillRequestingListener

javax.el.MethodExpression

Only EL

a method reference to a drill requesting listener

drillingEnabled

boolean

Yes

Default Value: true

Specifies whether drilling is enabled. The default value is true.

emptyText

String

Yes

The text of an empty pivot table. If the text is enclosed in an html tag, it will be formatted. The formatting behavior is similar to outputFormatted component.

headerFormat

javax.el.MethodExpression

Only EL

A MethodExpression that returns a oracle.adf.view.faces.bi.component.pivotTable.CellFormat given a oracle.adf.view.faces.bi.component.pivotTable.HeaderCellContext

headerFormatManager

oracle.adf.view.faces.bi.component.pivotTable.HeaderFormatManager

Yes

An instance of oracle.adf.view.faces.bi.component.pivotTable.HeaderFormatManager. It gives an application the ability to serialize their format rules for a specific pivot table across requests.

id

String

Yes

the identifier for the component

indentEnabled

boolean

Yes

Default Value: true

Specifies whether row labels for different levels of a hierarchical layer are indented. The default value is true.

inlineStyle

String

Yes

The inline style of the pivot table's outer DOM element. Can be used to control the size/position of the pivot table.

modelName

String

Yes

The model name of the Pivot Table. The model name is used to ensure that this Pivot Table can only pivot with a PivotFilterBar with the same model name.

partialTriggers

String[]

Yes

The IDs of the components that should trigger a partial update for pivot table. 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.

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.

A method reference to a pivot listener that will be called after a pivot operation is performed in pivot table

rendered

boolean

Yes

Default Value: true

Specifies whether the component is rendered. The default value is true.

rowFetchSize

int

Yes

Default Value: 25

The number of rows in a data fetch block. The default value is 25.

selection

oracle.adf.view.faces.bi.component.pivotTable.Selection

Yes

An instance of oracle.adf.view.faces.bi.component.pivotTable.Selection that keeps track of selected cells in pivot table

sizing

String

Yes

Valid Values: fixed, autoDefault Value: fixed

Valid Values: fixed, auto. Specifies how pivot table's size ( width/height ) is determined. When sizing="fixed", the pivot table is sized based on the width / height CSS properties in its default style or inline style property. When sizing="auto", the height of the pivot table is determined by the size of the content that is being displayed by the pivot table. If the content is smaller than the default size of the pivot table, then the pivot table will shrink. If the content is larger than the default size of the pivot table, the content will grow. To control maximum height / width of the pivot table, the max-height / max-width CSS properties can be specified using pixels in the inlineStyle property of the pivot table, as follows "max-width:400px;max-height:300px". Once the maximum height or width is exceeded, then pivot table will display scrollbars as needed. Please note that when sizing="auto", the pivot table's frame will initially be displayed with the default size of the pivot table ( using the width/height CSS attributes ) and then the pivot table's frame will readjust to fit its contents. This can cause the layout of the page displaying the pivot table to change after the page is initially displayed. The default value is "fixed".

sizingManager

oracle.adf.view.faces.bi.component.pivotTable.SizingManager

Yes

An instance of oracle.adf.view.faces.bi.component.pivotTable.SizingManager

sortListener

javax.el.MethodExpression

Only EL

A method reference to a sort listener that will be called after a sort operation is performed in pivot table

sortMode

String

Yes

Valid Values: grouped, ungrouped, noneDefault Value: grouped

Specifies the sort mode. Options are "grouped", "ungrouped", and "none". The default value is "grouped".

startColumn

int

Yes

Default Value: 0

The first visible column of data. The default value is 0.

startRow

int

Yes

Default Value: 0

The first visible row of data. The default value is 0.

statusBarRendered

boolean

Yes

Default Value: false

Specifies whether the status bar is rendered. The default value is false

styleClass

String

Yes

Sets a CSS style class to use for this component.

summary

String

Yes

Sets a summary of this pivot table's purpose and structure for user agents rendering to non-visual media (e.g. screen readers).

value

Object

Yes

the data model for the pivot table - can be an instance of oracle.adf.view.faces.bi.model.pivotTable.PivotTableModel or oracle.adf.view.faces.bi.model.DataModel

var

String

Yes

Name of the EL variable used to reference cell data within pivot table DataCell stamps. Once this component has completed rendering, this variable is removed (or reverted back to its previous value).

varStatus

String

Yes

Name of the EL variable used to reference the varStatus information. Once this component has completed rendering, this variable is removed (or reverted back to its previous value). The varStatus provides contextual information about the state of the component to EL expressions. The common properties on varStatus include: "members" - provides access to information about the header cells corresponding to (in the same row or column as) the current data cell "model" - returns the DataModel for this component "cellIndex" - returns the CellIndex of the current cell "cellKey" - returns the CellKey of the current cell

visible

boolean

Yes

Default Value: true

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. The default value is true.