The data renderer page displays the content to render within the column. By default, this page is called for each column when the grid items are iterated. The following parameters are passed to the data renderer page each time it is included:

Before customizing the data renderer page, perform the following steps:

  1. Refer to the Customization Best Practices section.

  2. Create a new application module for customizations. Include this module when starting JBoss. Refer to the ATG Platform Programming Guide for information on creating new application modules and the ATG Installation and Configuration Guide for information on starting JBoss.

  3. Locate the properties file that defines the column configuration.

  4. Inside the customization module, create an empty properties file at the corresponding path.

To configure the data render page with page fragments:

  1. Create a new JSP file in the module that will render the customized data.

  2. In this module, create a new PageFragment properties file under /config/atg/commerce/custsvc/ui/tables. For example, create a NewColumnRendererPage.properties file.

  3. In the properties file for the page fragment, set the URL and servletContext to reference the JSP page created in the customization module. For example:

    # @version $Id: //application/DCS-CSR/atg/commerce/custsvc/ui/tables/
    order/NewColumnRendererPage.properties
    $class=atg.web.PageFragment

    URL=/include/order/newColumnRenderer.jsp
    servletContext=DCS-CSR

  4. In the properties file for the column or grid, update the dataRendererPage property to point to the PageFragment properties file. For example:

    dataRendererPage=NewColumnRendererPage

Example: Customizing Column Content

This example replaces the Origin column in the default application with a Last Modified column in the Order History grid.

  1. In the resource bundle at /mycompany/resources/Resources.property, add a new key for the column title.

    lastModifiedDate=Last Modified

    To avoid a recompile of the JAR, add both the new resource bundle and the new key into your <ATG10dir>/locallib directory. You must restart your server once you have created the key.

  2. In the sample application, create a grid properties file at /atg/commerce/custsvc/
    ui/tables/order/OrderHistoryGrid.properties
    to override the default file. Override the columns property with the new columns; however, ensure that the invisible columns are included so that the order links work correctly:

    invisible data columns: DBState

    columns=\
      /atg/commerce/custsvc/ui/tables/order/Toggle,\
      /atg/commerce/custsvc/ui/tables/order/ViewLink,\
      /atg/commerce/custsvc/ui/tables/order/Total,\
      /atg/commerce/custsvc/ui/tables/order/ItemCount,\
      /atg/commerce/custsvc/ui/tables/order/ItemSummary,\
      /atg/commerce/custsvc/ui/tables/order/SubmittedDate,\
      /atg/commerce/custsvc/ui/tables/order/LastModified,\
      /atg/commerce/custsvc/ui/tables/order/State,\
      /atg/commerce/custsvc/ui/tables/order/SelectLink,\
      /atg/commerce/custsvc/ui/tables/order/DBState

  3. In the sample application, create the properties file for the column at /atg/commerce/custsvc/ui/tables/order/LastModified.properties that contains the configuration for the new column:

    $class=atg.svc.agent.ui.tables.ColumnConfiguration

    field=lastModified
    width=5em
    resourceBundle=mycompany.resources.Resources
    resourceKey=lastModifiedDate
    defaultSort=descending
    isVisible=true

    dataRendererPage=/atg/commerce/custsvc/ui/tables/order/
      LastModifiedRendererPage

  4. In the sample application, create the properties file for the content page at /atg/commerce/custsvc/ui/tables/order/
    LastModifiedRendererPage.properties
    :

    $class=atg.web.PageFragment
    URL=/panels/order/lastModifiedRenderer.jsp
    servletContext=/Sample-DCS-CSR-App

  5. In the sample application, create a JSP page at the location referred to by the page configuration. The JSP renders the last modified date property from the order:

    <%@ include file="/include/top.jspf"%>
    <dsp: page>
    <fmt: bundle basename="acme.resources.Resources">
      <dsp: getvalueof var="field" param="field"/>
      <dsp: getvalueof var="colIndex" param="colIndex"/>
      <dsp: getvalueof var="orderItemMap" param="orderItemMap"/>
      <c: choose>
      <c: when test="${field == 'lastModified'}">
        "lastModified": "${orderItemMap.lastModifiedDate}"
      </c: when>
      <c: otherwise>
      </c: otherwise>
      </c: choose>
    </fmt: bundle>
    </dsp: page>

  6. Test and verify that the last modified date column is rendered in the grid.

    Note: Default date formats can be modified using the webAppResources.properties file in the /WEB-INF directory.

Example: Creating Calculated Content

The following provides an example that returns calculated content.

  1. Follow the steps for creating customized content, as outlined in the Creating Column Content section.

  2. Create a JSP page that returns a calculation of one or more data items. For example:

    <%@ include file="/include/top.jspf"%>
    <dsp: page>
    <fmt: bundle basename="acme.resources.Resources">
      <dsp: getvalueof var="field" param="field"/>
      <dsp: getvalueof var="colIndex" param="colIndex"/>
      <dsp: getvalueof var="orderItemMap" param="orderItemMap"/>
      <c: choose>
    <c: when test="${field == 'totalNoTax'}">
      <dsp: tomap var="priceInfo" value="${orderItemMap.priceInfo}"/>
      <c: set var="totalValue"><dsp: valueof converter="currency"
        value="${priceInfo.amount+priceInfo.shipping}"/></c: set>
        "totalNoTax": "${totalValue}",
    </c: when>
    ...

  3. Test and verify that the calculation is rendered in the grid.


Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices