Oracle Fusion Middleware Data Visualization Tools Tag Reference for Oracle ADF Faces
11g Release 2 (11.1.2.0.0)

E17490-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();
            }
       
       

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

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:

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)




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.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.
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.
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.
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
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, auto
Default 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, none
Default 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.