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
Property view – Warranty information
Procedure
- Open the Java EE perspective.
- 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.
- Open one of the following files:
- ProductPrimaryObjectDefinition.lzx
- ProductPrimaryObjectDefinition.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. - Add the following code, immediately before the product
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>
- Right-click the LOBTools project and select Build OpenLaszlo Project.