Defining the combination box values

In this lesson, you define the values for the warranty term and warranty type combination boxes. A combination box is a GUI widget that contains a drop-down list of values that the user can select.

About this task

The following screen captures show the result of the customization.

List view – Warranty term

List view combination box

Property view – Warranty information

Property view combination boxes

Procedure

  1. Open the Java EE perspective.
  2. Complete one of the following steps:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > commerce > catalog > objectDefinitions.
    • Introduced in Feature Pack 2In the Enterprise Explorer view, expand LOBTools > WebContent > config > commerce > catalog > objectDefinitions.
  3. Open one of the following files:
    • WebSphere Commerce Version 7.0.0.0Feature Pack 1ProductPrimaryObjectDefinition.lzx
    • Introduced in Feature Pack 2ProductPrimaryObjectDefinition.def
    Tip: You define combination box values in an object definition file. Since warranty term and warranty type are product-level properties, you define values in one of these files.
  4. Add the following code, immediately before the product part number property definition:
    OptionDescription
    WebSphere Commerce Version 7.0.0.0Feature Pack 1ProductPrimaryObjectDefinition.lzx WebSphere Commerce Version 7.0.0.0Feature Pack 1Search for the text <!--- Property definition for the part number of the product --> and then paste the following code sample immediately before the line you located.
    <wcfPropertyDefinition propertyName="x_warterm" type="number">
      <wcfPropertyValue displayName="${extCatalogResources.productWarranty_DisplayNameForTerm1.string}" value="30"/>
      <wcfPropertyValue displayName="${extCatalogResources.productWarranty_DisplayNameForTerm2.string}" value="45"/>
      <wcfPropertyValue displayName="${extCatalogResources.productWarranty_DisplayNameForTerm3.string}" value="60"/>
    </wcfPropertyDefinition>
    
    <wcfPropertyDefinition propertyName="x_wartype" type="string">
      <wcfPropertyValue displayName="${extCatalogResources.productWarranty_DisplayNameForType1.string}" value="LIMITED"/>
      <wcfPropertyValue displayName="${extCatalogResources.productWarranty_DisplayNameForType2.string}" value="COMPREHENSIVE"/>
    </wcfPropertyDefinition>
    Introduced in Feature Pack 2ProductPrimaryObjectDefinition.def Introduced in Feature Pack 2Search for the text <!--- Property definition for the part number of the product --> and then paste the following code sample immediately before the line you located.
    <PropertyDefinition propertyName="x_warterm" type="number">
        <PropertyValue displayName="${extCatalogResources.productWarranty_DisplayNameForTerm1}" value="30"/>
        <PropertyValue displayName="${extCatalogResources.productWarranty_DisplayNameForTerm2}" value="45"/>
        <PropertyValue displayName="${extCatalogResources.productWarranty_DisplayNameForTerm3}" value="60"/>
    </PropertyDefinition>
    
    <PropertyDefinition propertyName="x_wartype" type="string">
        <PropertyValue displayName="${extCatalogResources.productWarranty_DisplayNameForType1}" value="LIMITED"/>
        <PropertyValue displayName="${extCatalogResources.productWarranty_DisplayNameForType2}" value="COMPREHENSIVE"/>
    </PropertyDefinition>
  5. Introduced in Feature Pack 2Right-click the LOBTools project and select Build OpenLaszlo Project.