Tutorials > Sales Center > Extend a page in an editor
Add tooltip help to the new page
In this part of the tutorial, we will add help information to the extended Order Summary page of the IBM Sales Center client to describe the new fields you created. You will add descriptive information that displays when the mouse hovers over a particular field called a tooltip.
Adding tooltip textTo add tooltip text, we will create a newOrderSummaryResources.properties file, add the translatable display text to the properties file, then update the definition of the control widgets to use that display text:
Procedure
- To create the newOrderSummaryResources.properties file:
- In the Package Explorer view, navigate to the orderEditorExtension plug-in.
- Inside the src folder, right-click on the orderEditorExtension package.
- Select New > File.
- In the File name field, enter newOrderSummaryResources.properties.
- Click Finish. The properties file opens for editing.
- To add the translatable display text to the newOrderSummaryResources.properties file:
- Add the following lines to the end of the file: OrderSummaryPage.receiverNameTooltip = Name of person receiving gift OrderSummaryPage.senderNameTooltip = Name of person sending gift OrderSummaryPage.message1Tooltip = Message text line 1 OrderSummaryPage.message2Tooltip = Message text line 2
- Save and close the file.
- To update the control widget definitions:
- In the orderEditorExtension plug-in, open the plugin.xml file for editing.
- In the Extensions tab, in the All Extensions pane, expand the com.ibm.commerce.widgets.controls plug-in.
- Modify the tooltip field of recipientLabel, senderLabel, message1Label, and message2Label by adding a reference to the tooltip text in the newOrderSummaryResources.properties file...
Label id tooltip field recipientLabel and recipientField OrderSummaryPage.receiverNameTooltip senderLabel and senderField OrderSummaryPage.senderNameTooltip message1Label and message1Field OrderSummaryPage.message1Tooltip message2Label and message2Field OrderSummaryPage.message2Tooltip
For example, the screen capture below displays the definition for recipientLabel:
To test the tooltip text:
- Launch the IBM Sales Center client.
- Go to the Summary page and hover the mouse pointer over the Name of recipient input field. Your tooltip help text displays...
- Close the IBM Sales Center client.