Show TOC

Client-Side Tray Options APILocate this document in the navigation structure

Use

The client-side Tray Options API enables you to create and manage custom options in the tray menu of a module. These options can either be actions performed on the module, or different views of the module.

ActionOption and ViewOption Objects

Represent an action option and a module view option respectively. The objects have the following properties:

Property

Description

text

The text of the option

position

The position of the option in the tray menu (1-100)

moduleID

The module ID

callback

( ActionOption only)

The callback function that implements the action

URL

( ViewOption only)

The URL of the module view, which can be any of the following:

  • PCD ID of an iView or a page, such as pcd:portal_content/iview_id

  • Relative URL of a portal component, such as /irj/servlet/prt/portal/prtroot/application_id.component_id

  • URL of a Web site

launchMode ( ViewOption only)

Defines how to launch the view. Possible string values are as follows:

  • inPlace

  • inPlaceMax

  • newWindow

roleAvailability

Defines the workspace user role(s) for which this option is available: workspace members, or managers, or both managers and members.

Possible values are defined by the following constants in the TrayOptions object:

  • EPCM.getSAPTop().TrayOptions.FOR_MEMBER

  • EPCM.getSAPTop().TrayOptions.FOR_MANAGER

  • EPCM.getSAPTop().TrayOptions.FOR_MANAGER_MEMBER

TrayOptions Object

Serves as a factory for creating and adding options to the module tray menu. To use the methods of the TrayOptions object, obtain a reference to the object as follows:

var trayOptionsManager = EPCM.getSAPTop().TrayOptions;

createAction(text, position, moduleID, callback, roleAvailability)

Creates an ActionOption object.

Parameters

See the above table.

createView (text, position, moduleID, URL, launchMode, roleAvailability)

Creates a ViewOption object.

Parameters

See the above table.

addOptions (options)

Adds the specified options to the module tray.

Parameters

options: An array of options, both actions and views

Note

Note that tray options created with the help of this API appear only in the module view in which they were added. The options are lost when the user navigates to a different module view.