Adding a column to the product list view of the Catalogs tool

In this lesson, you customize the product list view by adding warranty information for catalog entries. You update the list view to include a new column for the warranty property.

About this task

The following screen capture shows the default Management Center catalog entries List.

Catalog entry list before customization

After you complete these steps, a new column, WarrantyTerm, is added to the list view:

.Catalog entry list with warranty term column

Update the list view to include a new column:

Procedure

  1. Open WebSphere Commerce Developer.
  2. Open Java EE perspective and select the Enterprise Explorer view .
  3. Complete one of the following steps:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1 Navigate to LOBTools > WebContent > WEB-INF > src > lzx > commerce > catalog > listViewDefinitions
    • Introduced in Feature Pack 2 Navigate to LOBTools > WebContent > config > commerce > catalog > listViewDefinitions
  4. Open one of the following files:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1 CatalogEntryGrid.lzx
    • Introduced in Feature Pack 2 CatalogEntryGrid.def
  5. Add the new column to the list view. The list columns are defined as XML nodes in:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1 The lzx/commerce/catalog/listViewDefinitions/CatalogEntryGrid.lzx/catCatalogEntryBrowseGrid class.
    • Introduced in Feature Pack 2 The catCatalogEntryBrowseGrid definition.
    Each column can use a different widget to display data. For example:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1 Use the <wcfGridText> tag for simple text and the <wcfGridComboBox> tag to define a list of selectable options.
    • Introduced in Feature Pack 2 Use the <GridText> tag for simple text and the <GridComboBox> tag to define a list of selectable options.
    Locate the appropriate class definition and code:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1 Locate the class definition of lzx/commerce/catalog/listViewDefinitions/CatalogEntryGrid.lzx/catCatalogEntryBrowseGrid and add the code for the <wcGridComboBox> tag WebSphere Commerce Version 7.0.0.0Feature Pack 1
    1. Search for the following line: <class extends="wcfObjectGrid" name="catCatalogEntryBrowseGrid" preferenceKey="catCatalogEntryBrowseGrid">
    2. Add the code that is shown in bold to the following code:
      
      <wcfGridNumeric editable="true" name="sequence"
                  propertyName="sequence" required="false"
                  numDecimalPlaces="1"
                  text="${catalogResources.displaySequence.string}"
                  visible="true" width="130"/>
          
      <wcfGridText editable="false" name="catentryId"
                  objectPath="CatalogEntry" propertyName="catentryId"
                  text="${catalogResources.productUniqueId_ColumnHeader.string}"
                  visible="false" width="90"/>
      
      
      <wcfGridComboBox name="WarrantyTerm" editable="true"
      objectPath="CatalogEntry" propertyName="x_warterm"
      text="${extCatalogResources.productWarranty_ColumnHeader.string}" width="90" visible="true"/>
       
      
    Introduced in Feature Pack 2 Locate the catCatalogEntryBrowseGrid definition and add the code for the <GridComboBox> tag Introduced in Feature Pack 2
    1. Search for the following line: <ObjectGrid definitionName="catCatalogEntryBrowseGrid" preferenceKey="catCatalogEntryBrowseGrid">
    2. Add the code that is shown in bold to the following code:
      
      <GridNumeric editable="true" name="sequence" numDecimalPlaces="1" propertyName="sequence" required="false" text="${catalogResources.displaySequence}" visible="true" width="130"/>
          
      <GridText editable="false" name="catentryId" objectPath="CatalogEntry" propertyName="catentryId" text="${catalogResources.productUniqueId_ColumnHeader}" visible="false" width="90"/>
      
      
      <GridComboBox name="WarrantyTerm" editable="true" objectPath="CatalogEntry" propertyName="x_warterm" text="${extCatalogResources.productWarranty_ColumnHeader}" width="90" visible="true"/>
      
      
  6. Save and close the file.