Oracle Fusion Middleware Data Visualization Tools Tag Reference for Oracle ADF Faces
12c (12.2.1.2)

E76719-01

<dvt:pivotTable>

dvt:pivotTable pivotTable pivot table

UIComponent class: oracle.adf.view.faces.bi.component.pivotTable.UIPivotTable
Component type: oracle.dss.adf.pivotTable.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:

           
<dvt:pivotTable id="pt1" var="cellData" varStatus="cellStatus">
  <dvt:dataCell>
    <af:outputText id="ot1" value="#{cellData.dataValue}"/>
                   inlineStyle="color:#{(cellStatus.members.Product.dataValue == 'Canoes' ? 'red' : 'blue')};"/>
  </dvt:dataCell>
</dvt:pivotTable>
           
         
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".

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
Aggregates and collections
Advanced values
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
Aggregates, Drilling, and Additional values
Layer info

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.

Customizing Cell Content

In order to customize header cell content, use HeaderFormat attributes. For customizing data cell content, use DataFormat attributes. HeaderFormat/DataFormat attributes return instances of oracle.dss.adf.view.faces.bi.component.pivotTable.CellFormat. CellFormat instances allow specification of the following:

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.

       
            UIPivotTable pt = getPivotTable();
            if (pt == null)
                    return null;
            HeaderCellSelectionSet headerCells = null;
            if (pt.getSelection().getColumnHeaderCells().size() > 0) {
                headerCells = pt.getSelection().getColumnHeaderCells();
            } else if (pt.getSelection().getRowHeaderCells().size() > 0) {
                headerCells = pt.getSelection().getRowHeaderCells();
            }
       
       

Editing

Pivot Table supports a click-to-edit mode when it contains editable components. That implies a cell containing editable component will only be in edit mode if the user clicks on it (or hits the F2/Enter key). Users can use the Tab/Enter key or ctrl+arrow keys to navigate between cells while in edit mode.

Note that when a cell becomes editable, the component inside the cell might increase in size while it is rendered in edit mode (for example, af:selectOneChoice). This will have performance implications due to resizing. The recommendation is to use the SizingManager to make the row height larger if you have one of these components inside your cell so that resizing will not occur.

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.

Split Panes

The Split Panes feature allows the Pivot Table to be split into multiple panes vertically and/or horizontally. This facilitates side-by-side viewing of rows or columns that are not located next to each other. A split listener will be notified after a split is successfully added to or removed from the Pivot Table. The splitMode attribute specifies whether the Split Panes feature is enabled.

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

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

Attachment Mode

In attachment mode, content delivery is forced to immediate. Pivot Table will fetch and render all data cells in attachment mode. Since all cells are rendered, it is recommended to limit the size of the data model when running in attachment mode. Limited client interactivity, such as cell selection and row/column resizing, is available. Page scrolling policy and persistent layer label features are also supported. Split pane is supported for initial rendering only, you cannot split or unsplit after the pivot table is displayed. The following features are not supported in attachment mode:

Child Tags

This component can be the parent of:

Examples

Example 1 - Simple example

       
<dvt:pivotTable id="goodPT"                 
                value="#{pivotTableEditBean.dataModel}" /> 
       
       

Example 2 - Listeners

<dvt:pivotTable 
                value="#{richPivotTableModel.dataModel}"
                pivotListener="#{richPivotTableBean.handlePivotEvent}"
                drillRequestedListener="#{richPivotTableBean.handleDrillRequestedEvent}"              
                sortListener="#{richPivotTableBean.handleSortEvent}"/> 
       

Example 3 - Stamped SparkCharts

           
<dvt:pivotTable 
                value="#{pivotTableSparkChart.dataModel}"
                var="cellData"
                varStatus="cellStatus">
  <dvt:dataCell>
    <af:switcher id="s2"
                 facetname="O___b_cellData_dataIsTotal__b__"
                 defaultFacet="false">
      <f:facet name="true">
        <dvt:sparkChart id="sc1" shortDesc="Spark Chart"
                        highMarkerColor="#008200"
                        lowMarkerColor="#ff0000">
          <af:iterator id="i1"
                       value="#{cellData.aggregateCollection}"
                       var="sparks" >
            <dvt:sparkItem id="si1"
                           value="#{sparks.dataValue}"/>
          </af:iterator>
        </dvt:sparkChart>
      </f:facet>
      <f:facet name="false">
        <af:outputText id="ot1" value="#{cellData.dataValue}"/>
      </f:facet>
    </af:switcher>
  </dvt:dataCell>

  <dvt:headerCell>
    <af:switcher id="s3"
                 facetname="O___b_cellData_isTotal__b__"
                 defaultFacet="false">
      <f:facet name="true">
        <af:outputText id="ot2" value="Trend"/>
      </f:facet>
      <f:facet name="false">
        <af:outputText id="ot3" value="#{cellData.dataValue}"/>
      </f:facet>
    </af:switcher>
  </dvt:headerCell>
</dvt:pivotTable>
           
         

Example 4 - Stamped Gauges

           
<dvt:pivotTable 
                value="#{pivotTableGauge.dataModel}"
                var="cellData"
                varStatus="cellStatus">
  <dvt:dataCell>
    <dvt:gauge id="g1" shortDesc="Gauge"
               imageWidth="80" imageHeight="80" imageFormat="PNG_STAMPED"
               value="#{cellData.dataValue}"
               minValue="#{cellData.dataCubeMin}"
               maxValue="#{cellData.dataCubeMax}"/>
  </dvt:dataCell>
</dvt:pivotTable>
           
         

Example 5 - Formatting based on header cells

           
<dvt:pivotTable 
                value="#{pivotTableMemberFormatting.dataModel}"
                var="cellData"
                varStatus="cellStatus">
  <dvt:headerCell>
    <af:switcher 
                 facetname="O___b_cellData_layerName__b__"
                 defaultFacet="Other">
      <f:facet name="Product">
        <af:outputText id="ot1"
                       value="#{cellData.dataValue}"
                       inlineStyle="color:#{(cellData.dataValue == 'Canoes' ? 'red' : 'blue')};"/>
      </f:facet>
      <f:facet name="Other">
        <af:outputText id="ot2" value="#{cellData.dataValue}"/>
      </f:facet>
    </af:switcher>
  </dvt:headerCell>
 
  <dvt:dataCell>
    <af:outputText id="ot3" value="#{cellData.dataValue}"
                   inlineStyle="color:#{(cellStatus.members.Product.dataValue == 'Canoes' ? 'red' : 'blue')};"/>
  </dvt:dataCell>
</dvt:pivotTable>
           
         

Screen Shot(s)


PivotTable screenshot

Events

Type Phases Description
oracle.adf.view.faces.bi.event.DrillEvent Invoke Application 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.pivotTable.SplitEvent Invoke Application The split event is delivered after a split is successfully added to or removed from the Pivot Table.
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
columnFetchSize int Yes Default Value: 10

The number of columns in a data fetch block. The default value is 10.
columnHeaderStartLayer int Yes Default Value: 0

The first visible layer in the column header. The default value is 0.
contentDelivery String Yes Valid Values: lazy, immediate, whenAvailable
Default Value: whenAvailable

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.
headerSortMode String Yes Valid Values: grouped, none
Default Value: grouped

Specifies the header sort mode. Options are "grouped" and "none". The default value is "grouped".
id String No 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.
layerLabelMode String Yes Valid Values: rendered, hidden
Default Value: hidden

Specifies whether layer/dimension labels appear above each row header layer and beside each column header layer. Options are "rendered" and "hidden". The default value is "hidden".
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.
pivotEnabled boolean Yes Default Value: true

Specifies whether pivoting is enabled. The default value is true.
pivotLabelVisible boolean Yes Default Value: true

Specifies whether layer/dimension labels are visible on pivot handles. The default value is true.
pivotListener javax.el.MethodExpression Only EL A method reference to a pivot listener that will be called after a pivot operation is performed in pivot table
preferredColumnHeaderHeight String Yes The preferred height of the column header, as a percentage of the total available height of the Pivot Table, e.g. "40%"
preferredRowHeaderWidth String Yes The preferred width of the row header, as a percentage of the total available width of the Pivot Table, e.g. "40%"
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.
rowHeaderStartLayer int Yes Default Value: 0

The first visible layer in the row header. The default value is 0.
scrollPolicy String Yes Valid Values: auto, page, scroll
Default Value: auto

Specifies the mechanism used to scroll data within the Pivot Table. Possible values are: auto (depends on your device), page, and scroll.
secondStartColumn int Yes Default Value: the value of splitColumn

The first visible column of data in the second pane. The default value is the value of splitColumn; i.e. the pane is scrolled to the beginning by default.
secondStartRow int Yes Default Value: the value of splitRow

The first visible row of data in the second pane. The default value is the value of splitRow; i.e. the pane is scrolled to the beginning by default.
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, auto
Default Value: fixed

Specifies how the pivot table's size ( width/height ) is determined. When sizing="fixed", either the pivot table is sized by its parent (if the parent stretches its children) or its width and height are the values computed from the skin, styleClass, and inlineStyle (if the parent does not stretch its children). When sizing="auto" and the parent stretches its children, "auto" is ignored and the pivot table is sized as in the "fixed" case above. When sizing="auto" and the parent does not stretch its children, the pivot table will shrink to the size of its content if the content is smaller than the pivot table. Specifically, Pivot Table width = min(content width, default width ), and Pivot Table height = min(content height, default height), where "default width" and "default height" are the width and height computed from the skin, styleClass, and inlineStyle. Please note that when sizing="auto", the pivot table's frame will initially be displayed with the default size of the pivot table ( as defined above ) 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, none
Default Value: grouped

Specifies the data sort mode. Options are "grouped", "ungrouped", and "none". The default value is "grouped".
splitColumn int Yes Default Value: -1

The first column of data in the second pane (this column may be scrolled out of view), or -1 if columns are not split.
splitListener javax.el.MethodExpression Only EL A method reference to a split listener that will be called after a split is successfully added to or removed from the Pivot Table
splitMode String Yes Valid Values: enabled, disabled
Default Value: disabled

Specifies the split mode, which controls whether the split-panes feature is enabled. Options are "enabled" and "disabled". The default value is "disabled".
splitRow int Yes Default Value: -1

The first row of data in the second pane (this row may be scrolled out of view), or -1 if rows are not split.
startColumn int Yes Default Value: 0

The first visible column of data. If panes are split so that there is both a left and right databody pane, this attribute is for the first pane. The default value is 0.
startRow int Yes Default Value: 0

The first visible row of data. If panes are split so that there is both a top and bottom databody pane, this attribute is for the top pane. 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 No 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 No 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.