Show TOC

Syntax documentationTray Service Locate this document in the navigation 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:

Syntax Syntax

  1. 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);
    }
    
End of the code.

Note 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 the note.
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