In this lesson, you create the Management Center user interface element in
which business users specify the free gift and quantity information for the promotion.
This Management Center user interface element is a list view that is used in a
properties view definition, which you create in the next lesson.
About this task
For this new promotion type, business users can specify a gift comprising multiple
(different) catalog entries in varying quantities. To support this in the user interface, you need a
grid that includes the following columns:
- Type
- Catalog entry
- Quantity for free
By default, the Promotions tool has a gift reward grid. The grid does not include the
Quantity for free column. To support your new promotion type, you add this
column Quantity for free as shown in the following image.
You must also customize this gift grid to allow business users to add additional rows, to
accommodate multiple (different) catalog entries as gifts. This is covered in the next
lesson.
Procedure
-
Create a folder for the gift reward list view definition
-
In the Enterprise Explorer view, expand directory.
-
Right-click the promotion folder and click .
-
In the Folder name field, type
listViewDefinitions.
-
Click Finish.
-
Create a new definition file to define the new gift list view
-
Right-click the listViewDefinitions folder.
-
Click . Name your new file ChildListEditorListViews.xml.
-
Click Finish to save the file. The file opens in the default XML
editor.
-
Copy and paste the following code into the file.
<Definitions>
<ObjectGrid baseDefinition="cmc/promotion/ProductGrid"
definitionName="cmc/promotion/ExtProGiftRewardGrid" preferenceKey="extProductGrid">
<dependency localName="ExtPromotionResources" moduleName="cmc/promotion/ExtPromotionResources"/>
<GridStepper editable="true" minimumValue="1" name="giftQuantity" propertyName="giftQuantity" required="true"
text="${ExtPromotionResources.promotion_Free_gift_qty}" visible="true" width="200"/>
</ObjectGrid>
</Definitions>
-
Save and close the file.
This definition extends ProductGrid definition, which the Promotions tool provides. This
definition displays the contents and characteristics of a list of SKUs, products, or kits as
promotion gifts. On this grid, the previous code sample adds a new column named giftQuantity to
capture this value. The GridStepper class is used as an input widget to allow business users to
enter an integer for the gift quantity. This column is defined as a mandatory entry, and the minimum
value is 1.
Results
In this lesson, you created the Management Center widget where business users can specify
the promotion gifts and their quantity. In the next lesson, you create the remaining Management
Center user interface widgets to support your promotion.