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

E23187-01

<dvt:dataCell>

dvt:dataCell dataCell data cell

UIComponent class: oracle.adf.view.faces.bi.component.pivotTable.UIDataCell
Component type: oracle.dss.adf.pivotTable.DataCell

Each immediate child of a Pivot Table component must either be a <dvt:headerCell> or <dvt:dataCell> component. The Pivot Table should contain at most one headerCell component and at most one dataCell component. These components make it possible to customize the cell content via stamping. For example, each dataCell can contain non-editable content or editable content.

Data Cell Features

Stamping

Rather than having a separate child component for each cell in the pivot table, the child component of the dataCell component is repeatedly rendered (stamped) once per data cell. Because of this stamping behavior, only certain types of components are supported as children inside a Data Cell. Supported components include all components with no behavior and most components that implement the EditableValueHolder or ActionSource interfaces.

As the dataCell content is stamped, the data for the current cell is copied into an EL reachable property. The name of this property is defined by the var property on the Pivot Table. Once the Pivot Table has completed rendering, this property is removed (or reverted back to its previous value). In the following example, the data for each cell is placed under the EL property "cellData". Each data cell displays its content by getting further properties from the "cellData" property. See the <dvt:pivotTable> tagdoc for more information.

        
                        <dvt:pivotTable id="goodPT" var="cellData">
                            <dvt:dataCell id="dc1">
                                <af:outputText id="ot1" value="#{cellData.dataValue}" />
                            </dvt:dataCell>                   
                        </dvt:pivotTable>
        
        

Customized Cell Content and Style

For customizing data cell content, use DataFormat. DataFormat attribute returns instances of oracle.dss.adf.view.faces.bi.component.pivotTable.CellFormat. CellFormat instances allow specification of the following:

Data Cell content can be specified by using a logical component such as <af:switcher>.

The following example shows how Data Cell supports alternative cell content using <af:switcher> based on the stamping property. In other words, the stamping content is customized on a cell by cell basis depending on a variable value ("#{richPivotTableModel.stampFacet}"). The example also shows custom CSS styling using inlineStyle and contentStyle attributes of outputText and inputText respectively.

        
                <dvt:pivotTable id="goodPT"
                           value="#{richPivotTableModel.dataModel}"
                           var="cellData"
                           varStatus="cellStatus">           
        
                  <dvt:dataCell id="dc1"> 
                    <af:switcher id="sw1" facetname="O__richPivotTableModel_stampFacet_">
                      <f:facet name="outputText">         
                        <af:outputText id="ot1" value="#{cellData.dataValue}" inlineStyle="#{myBean.textStyle}"/>    
                      </f:facet>  
                      <f:facet name="inputText">  
                        <af:inputText id="ot2" value="#{cellData.dataValue}" contentStyle="#{myBean.textStyle}" />   
                      </f:facet>
                    </af:switcher>
                  </dvt:dataCell>
                </dvt:pivotTable>
        
        

The following example uses <af:switcher> to vary the type of stamped component by measure (i.e. different content for Sales, Weight, etc.). The example also shows different components that can be used as child tag of <dvt:dataCell>

        

          <dvt:pivotTable id="goodPT" var="cellData" varStatus="cellStatus" sizingManager="richPivotTable.sizingManager">
            <dvt:dataCell>                    
              <af:switcher id="sw" facetname="O__cellStatus_members_MeasDim_value_" defaultFacet="Other">
                <f:facet name="Sales">
                  <af:inputText id="idinputtext1" value="#{cellData.dataValue}"   />  
                </f:facet>
                <f:facet name="Units">
                  <af:inputText id="idinputtext2" value="#{cellData.dataValue}"   >      
                    <af:validateLength maximum="6" minimum="2" />
                  </af:inputText>
                </f:facet>
                <f:facet name="Weight">
                  <af:outputText id="idoutputtext1" value="#{cellData.dataValue}" />
                </f:facet>
                <f:facet name="Color">
                  <af:selectOneChoice id="idselectonechoice"
                                      value="#{cellData.dataValue}" label="Color">
                    <af:selectItem label="red" value="red" shortDesc="shortDesc sample"/>                                
                    <af:selectItem label="coffee" value="coffee" shortDesc="Sample shortDesc text"/>                            
                    <af:selectItem label="milk" value="milk" shortDesc="Another shortDesc sample"/>                            
                  </af:selectOneChoice>
                </f:facet>
                <f:facet name="Available">
                  <af:selectBooleanCheckbox id="idselectbooleancheckbox" label="Availability" text="Item Available"
                                            autoSubmit="true" value="#{cellData.dataValue}"/>                    
                </f:facet>
                <f:facet name="Supply_Date">
                  <af:inputDate id="idinputdate1" value="#{cellData.dataValue}"
                                 label="Change Date:" simple="true" >                        
                    <af:validateDateTimeRange maximum="2020-12-31" minimum="1980-12-31" />
                  </af:inputDate>
                </f:facet>
                <f:facet name="Link">
                  <af:commandLink text="#{cellData.dataValue}" immediate="true" action="guide" id="idcommandlink"/>
                </f:facet>
                <f:facet name="Size">
                  <af:inputComboboxListOfValues label="Size" id="idInputComboboxListOfValues"                                       
                             value="#{cellData.dataValue}"  searchDesc="Search Size"                                        
                             model="#{pivotTableEditBean.listOfValuesModel}"                            
                             columns="3"   />
                </f:facet>
                <f:facet name="Other">
                  <af:outputText id="idoutputtext2" value="#{cellData.dataValue}"   />  
                </f:facet>
              </af:switcher>
            </dvt:dataCell>
          </dvt:pivotTable>

        
        

Note that if you use different types of input components in a cell (as in the example above), you should use the SizingManager in Pivot Table to ensure that the height of the cells remains the same when editing from cell to cell. This is because the height of the input components might varies, and switching from one type of component to another would cause the Pivot Table to resize accordingly, and this could have a performance impact if the Pivot Table contains a lot of cells.

Supported Child Tags

Examples of components that are supported by <dvt:dataCell> include but are not limited to the following:

The dataCell should have only one child component. If multiple children are desired, they should be wrapped in another component. If no layout is desired, <af:group> can be used, which simply renders its children without adding layout, and is consequently lightweight. If layout is desired, a layout component like <af:panelGroupLayout> can be used instead. If multiple children are present without being wrapped, the current behavior is to vertically stack the components, but no guarantees or support are provided for this usage. To achieve vertical stacking, consider <panelGroupLayout layout="vertical">.

Example

The following example shows a way to use stamping

        
                <dvt:pivotTable 
                      value="#{pivotTableEdit.dataModel}"                                         
                      var="cellData"
                      varStatus="cellStatus">
                  <dvt:dataCell id="dc1">                    
                    <af:outputText id="ot1" value="#{cellData.dataValue}"   />  
                  </dvt:dataCell>
                </dvt:pivotTable>
        
        

Screen Shot(s)


No image.

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.

Attributes

Name Type Supports EL? Description
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 String Only EL Binding reference to store the UIDataCell component
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.
dataAttribute String Yes This attribute is deprecated. A switcher should be used instead. The data attribute (e.g. Sales, Cost, ... ) that has its data cell content rendered by this DataCell. If not specified or empty(""), then the DataCell is used as the default data cell content.
id String No the identifier for the component. Every component may be named by a component identifier that must conform to the following rules:
  • They must start with a letter (as defined by the Character.isLetter() method) or underscore ( _ ).
  • Subsequent characters must be letters (as defined by the Character.isLetter() method), digits as defined by the Character.isDigit() method, dashes ( - ), or underscores ( _ ). To minimize the size of responses generated by JavaServer Faces, it is recommended that component identifiers be as short as possible. If a component has been given an identifier, it must be unique in the namespace of the closest ancestor to that component that is a NamingContainer (if any).
inlineStyle String Yes The inline style of the data cell's DOM element.
rendered boolean Yes Default Value: true

Specifies whether the component is rendered. The default value is true.
styleClass String Yes Sets a CSS style class to use for this component.