Tutorials > Management Center > Add new fields in the Catalogs tool

< Previous | Next >


Define combo box values

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

The following screen captures show the result of the customization.

List view – Warranty term

Property view – Warranty information


Procedure

  1. Open the Java EE perspective.

  2. Complete one of the following steps:

    • In the Enterprise Explorer view, expand LOBTools > WebContent > WEB-INF > src > lzx > commerce > catalog > objectDefinitions.

    • In the Enterprise Explorer view, expand LOBTools > WebContent > config > commerce > catalog > objectDefinitions.

  3. Open one of the following files:

    • ProductPrimaryObjectDefinition.lzx

    • ProductPrimaryObjectDefinition.def

    Tip: You define combination box values in an ObjectDefinition 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's part number property definition:

    Option Description
    ProductPrimaryObjectDefinition.lzx Search 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>
    

    ProductPrimaryObjectDefinition.def Search 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. Right-click the LOBTools project and select Build Open Laszlo Project.

< Previous | Next >


+

Search Tips   |   Advanced Search