Tutorials > Sales Center > Add a column to the order items table
Create a new definition for the user interface widget
In this step we will create the own definition of the order items table. In a later step in this tutorial we will use the system configurator to indicate the IBM Sales Center should display this definition, not the default definition.
Procedure
- Click the Extensions tab.
- Click Add.
- From the Available Extension Point list, select com.ibm.commerce.telesales.widgets.tableDefinitions. This is the extension point for creating a new table definition.
- Click Finish.
- Right-click com.ibm.commerce.telesales.widgets.tableDefinitions and select New > tableDefinition.
- In the Extensions Element Details pane:
- Set the id to customizedItemTable
- Set the referenceId value to com.ibm.commerce.telesales.ui.impl.orderItemPageTableDefinition.default and save the changes.
Recall the information you determined in the Determine the ID of the user interface widget to modify step. The referenceId is the default table definition defined in plug-in com.ibm.commerce.telesales.ui.impl.order. Since the new table is the same as the old table with one new availability date column, you use the referenceId to reference the existing column definitions instead of re-defining them in this plug-in.
- Right-click customizedItemTable and select New > column.
- In the Extensions Element Details pane, set the following values:
Name Value Id availabilityDate Alignment LEFT Text extendedOrderItem.availabilityDate minimumWidth 20 Resizable True managerType standard modelPath product.availabilityDate
This creates the new column with the Id of availabilityDate. The text for the column references the properties file entry created previously. The modelPath value defines how the column is populated, the first part of the model path describes the model. The second part of the modelPath value is an attribute of the model. In this case the value represents the name of the name value pair we will read from the BOD. The remaining properties define column attributes.
- Save the changes.
- Right-click availabilityDate and select New > property.
- In the Extensions Element Details pane, set the following values:
Name Value name columnType value com.ibm.commerce.telesales.ui.impl.orderItemPageItemTableAvailabilityDate
- Save the file.
- Click the plugin.xml tab and examine the table definition's source code:
<tableDefinition referenceId="com.ibm.commerce.telesales.ui.impl.orderItemPageTableDefinition.default" > <column resizable="true" text="extendedOrderItem.availabilityDate" managerType="standard" minimumWidth="20" alignment="LEFT" modelPath="product.availabilityDate" > <property value="com.ibm.commerce.telesales.ui.impl.orderItemPageItemTableAvailabilityDate" name="columnType"/> </column> </tableDefinition>