
The tray service enables you to add a menu item to an iView or page tray, and to specify a Web Dynpro action to execute when the menu item is selected.
The following is an example of adding an iView and page menu item:
ITrayService trayService = (ITrayService)
WDPortalUtils.getService(ITrayService.KEY);
if (trayService != null) {
// Add iView tray menu item
trayService.addIViewItem("addItemComment", "Add Comment",
wdThis.wdGetAddItemCommentAction(), null);
// Add page tray menu item
trayService.addPageItem("addItemComment", "Add Comment",
wdThis.wdGetAddItemCommentAction(), null);
}
Generally, tray menu items are added in the wdDoModifyView() method. Make sure to add the menu item once; otherwise, duplicate menu items are displayed.
Dependencies
In order to use the APIs in this section, you must create the following dependency references in your project:
|
SC |
DC |
|---|---|
|
EP-RUNTIME |
tc/ep/pagebuilder/api |