<dvt:dataCell>

dvt:dataCell dataCell data cell

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

Data cell component provides stamping to customize the content. For example, each data cell content can contain a read-only or an input component. This tag also supports customized CSS style for the cells.

Data Cell Features

Stamping

The child component of each Data Cell displays the data for specific data attribute in the pivot table. Data Cell does not create child components per data attribute; instead, each data cell is repeatedly rendered (stamped) once per data attribute. 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 data attribute is stamped, the data for the current data attribute 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 row is placed under the EL property "cellData". Each data cell displays the data for each data attribute by getting further properties from the "cellData" property:

        
                        <dvt:pivotTable var="cellData" >
                            <dvt:dataCell dataAttribute="Sales">                    
                                 <af:inputText  value="#{cellData.dataValue}"   />  
                            </dvt:dataCell>
                            <dvt:dataCell dataAttribute="Weight">
                                <af:outputText value="#{cellData.dataValue}" />
                            </dvt:dataCell>                   
                            <dvt:dataCell dataAttribute="Available">                    
                                <af:selectBooleanCheckbox id="idselectbooleancheckbox" label="Availability" text="Item Available"
                                              autoSubmit="true" 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 various ways:

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 
                           value="#{richPivotTableModel.dataModel}"
                           var="cellData"
                           varStatus="cellStatus" >          
        
                            <dvt:dataCell>      <!-- only one data cell is used as default for all measures -->
                              <af:switcher facetname="O__richPivotTableModel_stampFacet_">
                                <f:facet name="outputText">               
                                  <af:outputText  value="#{cellData.dataValue}" inlineStyle="#{cellStatus.cellFormat.textStyle}"/>    
                                </f:facet>  
                                <f:facet name="inputText">  
                                  <af:inputText  value="#{cellData.dataValue}" contentStyle="#{cellStatus.cellFormat.textStyle}" />   
                                </f:facet>
                          </af:switcher>
                            </dvt:dataCell>
                </dvt:pivotTable>
        
        

The following example uses dataAttribute attribute to determine the type of input component inside data cell based on different measures.

        
                        <dvt:pivotTable var="cellData" >
                            <dvt:dataCell dataAttribute="Sales">                    
                                 <af:inputText  value="#{cellData.dataValue}"   />  
                            </dvt:dataCell>
                            <dvt:dataCell dataAttribute="Weight">
                                <af:outputText value="#{cellData.dataValue}" />
                            </dvt:dataCell>                   
                            <dvt:dataCell dataAttribute="Available">                    
                                <af:selectBooleanCheckbox 
                                              autoSubmit="true" value="#{cellData.dataValue}"/>                    
                            </dvt:dataCell>
                    <dvt:dataCell>  <!-- this is the default data cell that will be used for data attributes other than the ones specified before-->
                                 <af:outputText  value="#{cellData.dataValue}"   />  
                            </dvt:dataCell>       
                        </dvt:pivotTable>
        
        

Supported Child Tags

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

Example

The following example shows a way to use stamping, and to use one data cell as default content for pivot table

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

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.

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 oracle.adf.view.faces.bi.component.<wbr/>pivotTable.UIDataCell 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.
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 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. 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 ('-').
rendered boolean Yes whether the component is rendered. When set to false, no output will be delivered for this component (the component will not in any way be rendered, and cannot be made visible on the client).