Start of Content Area

Syntax documentation Tray Service  Locate the document in its SAP Library structure

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:

IWDTrayService trayService = (IWDTrayService)
    WDPortalUtils.getService(WDPortalServiceType.TRAY_SERVICE);

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);
}

Note

Generally, tray menu items are added in the wdDoModifyView() method. Make sure to add the menu item once; otherwise, duplicate menu items are displayed.

 

End of Content Area