Tutorials > Sales Center > Add a new search option in the IBM Sales Center
Create a gridCompositeDefinition
In the previous step, you created three control widgets to define the new search option. In this step we will create the gridCompositeDefinition that groups the three widgets together. The composite definition is tied to the first composite control and adds the second and third controls as its children.
To create the gridCompositeDefinition:
Procedure
- In the Editor view, click the Extensions tab.
- Click Add.
- From the Available extension points list, select com.ibm.commerce.telesales.widgets.compositeDefinitions and click Finish.
- Right-click com.ibm.commerce.telesales.widgets.compositeDefinitions and click New > gridCompositeDefinition.
- In the Extension Element Details pane, set the following values. Notice that the id value is the same as the id you specified for the first control widget:
Detail Value id productQuickPageMFPartNumCompositeDefinition layoutId com.ibm.commerce.telesales.ui.impl.standardGridLayout
- Save the file.
- In the All Extensions pane, right-click productQuickPageMFPartNumCompositeDefinition, and select New > row. This row will contain the label and input field.
- In the Extension Element Details pane, set the id of the new row to findProductMFPartNumberRow.
- Save the file.
- In the All Extensions pane, select findProductMFPartNumberRow, and select New > control.
- In the Extension Element Details pane, set the following values. Notice that the controlId value is the same as the id you specified in the label control:
Detail Value controlId MyNewSearchOptionLabel dataId com.ibm.commerce.telesales.ui.impl.requiredLabelGridData
- Save the file.
- Repeat the previous two steps with the following values. Notice that the controlID value is the same as the id you specified in the input field control widget:
Detail Value controlId MyNewSearchOptionField dataId com.ibm.commerce.telesales.ui.impl.findTextFieldGridData
- Save the file.
View the source codeTo view the the changes in the source code of the plugin.xml file:
- Click the plugin.xml tab.
- Examine the source code and view the changes in the source code.
<extension point="com.ibm.commerce.telesales.widgets.compositeDefinitions"> <gridCompositeDefinition layoutId="com.ibm.commerce.telesales.ui.impl.standardGridLayout"> <row > <control controlId=" MyNewSearchOptionLabel" dataId="com.ibm.commerce.telesales.ui.impl.requiredLabelGridData"/> <control controlId=" MyNewSearchOptionField" dataId="com.ibm.commerce.telesales.ui.impl.findTextFieldGridData"/> </row> </gridCompositeDefinition> </extension>