How to Construct a CellFormat Object

26-14 Web User Interface Developers Guide for Oracle Application Development Framework Figure 26–14 Pivot Table Using Data Cell Stamping

26.10.1 How to Specify Custom Images for Data Cells

With data cell stamping you can use the dvt:dataCell tag to specify a custom image for a data cell using af:image, af:icon, or af:commandImageLink as a child tag. Example 26–8 shows sample code for using an af:commandImageLink as a custom image in a pivot table data cell. Example 26–8 Using a Custom Image for a Data Cell dvt:pivotTable var=cellData varStatus=cellStatus -- This is the default data cell that will be used for all data attributes-- dvt:dataCell af:commandImageLink text=Go icon=imagesgo.gif actionListener={pivotTableBean.imageLinkClick} af:outputText value={cellData.dataValue} dvt:dataCell dvt:pivotTable Actions associated with the image are handled through a registered listener, actionListener. In a bean class you specify the method to be called when the image link is clicked, for example: public void imageLinkClick javax.faces.event.ActionEvent.action

26.10.2 How to Specify Images, Icons, Links, and Read-Only Content in Header Cells

In the same way that you use stamping in data cells, you can customize the content in header cells using the dvt:headerCell child component to place a read-only component in each header cell. Only read-only components or noneditable components are supported, including af:outputText, af:image, af:icon, af:commandImageLink, and af:commandLink. Example 26–9 shows sample code for using an af:commandImageLink as a custom image and af:icon as a custom icon in pivot table header cells. Example 26–9 Using Custom Components in Header Cells dvt:pivotTable id=goodPT binding={pivotTableHeaderCellDemo.pivotTable} contentDelivery=immediate value={pivotTableHeaderCellDemo.dataModel} var=cellData varStatus=cellStatus -- header cell components -- Note: In order to temporarily or permanently write values back to a set of cells within a cube, called a writeback, the pivot table must be bound to a data control or data model that supports writeback operations. A row set based data control is transformed into a cube and therefore cannot support writeback operations.