Entering content frame

InfoSource documentation Client Events Locate the document in its SAP Library structure

The events in this chapter are provided by the JavaScript object EPCM that exists on every Portal page, when the EPCF service is activated.

External Portal applications that have no EPCM object must use the regular page client API.

The events expect a parameter in the form:

{Id : "iview id" , Window : iview HTML frame window}

If the iView ID is not null, the window parameter is ignored. The window parameter was designed to support Java Portal applications and external iViews using the URL or PUMPED isolation mode. According to the kind of iView set the parameter as follows:

·        For a Java Portal application, specify the iView ID and set the window parameter to null.

·        For an external iView, set the iView ID to null and the window parameter to self.

 

You get the iView ID using the Portal Runtime (PRT) API on the server with following command:

request.getComponentContext ().GetContextName ();

 

Related documents:

Isolation modes

Client API

EPCF service

 

The page builder has following events:

 

expand

EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "expand", {Id:id, Window:window})

The expand event opens an iView in a new window.

This event simulates the Open in new window option of the iView tray.

Parameter Description

Argument

Type

Description

id

String

iView ID of the iView.

Window

Object

The HTML window object of the iView.

Usage

<SCRIPT language ="JavaScript">

   ...

// For Java Portal components:

   EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "expand",

    {Id:"<%=componentRequest.getComponentContext().GetContextName()%>"

    , Window:null})

   ...

// For external iviews

   EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "expand",

    {Id:null, Window:self})

   ...

<SCRIPT>

 

refresh

EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "refresh", {Id:id, Window:window})

The refresh event refreshes an iView. If the iView content is in the Portal cache it will be replaced by new content generated for this iView.

This event simulates the Refresh option of the iView tray.

Parameter Description

Argument

Type

Description

id

String

iView ID of the iView.

Window

Object

The HTML window object of the iView.

Usage

<SCRIPT language ="JavaScript">

   ...

// For Java Portal components:

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "refresh",

   {Id:"<%=componentRequest.getComponentContext().GetContextName()%>",
    Window:null})

 

// For external iViews

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "refresh",
   {Id:null, Window:self})

   ...

<SCRIPT>

 

reload

EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "reload", {Id:id, Window:window})

The reload event reloads an iView. The iView content is retrieved from the Portal cache.

Parameter Description

Argument

Type

Description

id

String

iView ID of the iView.

Window

Object

The HTML window object of the iView.

Usage

<SCRIPT language ="JavaScript">

   ...

// For Java Portal components:

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "reload",

   {Id:"<%=componentRequest.getComponentContext().GetContextName()%>",
    Window:null})

 

// For external iViews

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "reload",
   {Id:null, Window:self})

   ...

<SCRIPT>

 

personalize

EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "personalize", {Id:id, Window:window})

The reload event starts the personalization dialog. This event simulates the Personalize option of the iView tray.

Parameter Description

Argument

Type

Description

id

String

iView ID of the iView.

Window

Object

The HTML window object of the iView.

Usage

<SCRIPT language ="JavaScript">

   ...

// For Java Portal components:

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "personalize",

   {Id:"<%=componentRequest.getComponentContext().GetContextName()%>",
    Window:null})

 

// For external iViews

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "personalize",
   {Id:null, Window:self})

   ...

<SCRIPT>

 

remove

EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "remove", {Id:id, Window:window})

The remove event removes the iView from the page.

When the iView was added to the page by the user with the personalization dialog, the iView will be deleted from the page.

When the iView was set on the page by the administrator, the iView will be hidden and not deleted. The iView can be made visible again with the personalization dialog by the user.

This event simulates the Remove from page option of the iView tray.

Parameter Description

Argument

Type

Description

id

String

iView ID of the iView.

Window

Object

The HTML window object of the iView.

Usage

<SCRIPT language ="JavaScript">

   ...

// For Java Portal components:

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "remove",

   {Id:"<%=componentRequest.getComponentContext().GetContextName()%>",
    Window:null})

 

// For external iViews

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "remove",
   {Id:null, Window:self})

   ...

<SCRIPT>

 

help

EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "help", {Id:id, Window:window})

The help event starts the help component for the iView. This event simulates the Help option of the iView tray.

Parameter Description

Argument

Type

Description

id

String

iView ID of the iView.

Window

Object

The HTML window object of the iView.

Usage

<SCRIPT language ="JavaScript">

   ...

// For Java Portal components:

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "help",

   {Id:"<%=componentRequest.getComponentContext().GetContextName()%>",
    Window:null})

 

// For external iViews

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "help",
   {Id:null, Window:self})

   ...

<SCRIPT>

 

adjustHeight

EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "adjustHeight",
{Id:id, Window:window, [,Height:height]})

The adjustHeight event adjusts the height of the IFrame that contains the iView.

This method is only relevant for iViews using URL or PUMPED isolation mode.

Use this event when the iView changes its size and you want the IFrame to change its size also. If you do not specify the height parameter, the IFrame height will be adjusted to the current size of the iView. This is same behaviour as for iViews that have the automatic height property.

Parameter Description

Argument

Type

Description

id

String

iView ID of the iView.

Window

Object

The HTML window object of the iView.

height

Integer

Height of the IFrame.

Usage

<SCRIPT language ="JavaScript">

   ...

// For Java Portal components:

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "adjustHeight",

   {Id:"<%=componentRequest.getComponentContext().GetContextName()%>",
    Window:null})

 

// For external iViews

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", " adjustHeight ",
   {Id:null, Window:self})

   ...

<SCRIPT>

 

recalcTray

EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "recalcTray", {Id:id, Window:window})

This event is for Netscape browsers to adjust the tray size (which contains the iView) according to iView content.

Parameter Description

Argument

Type

Description

id

String

iView ID of the iView.

Window

Object

The HTML window object of the iView.

Usage

<SCRIPT language ="JavaScript">

   ...

// For Java Portal components:

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "recalcTray",

   {Id:"<%=componentRequest.getComponentContext().GetContextName()%>",
    Window:null})

 

// For external iViews

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", " recalcTray ",
   {Id:null, Window:self})

   ...

<SCRIPT>

 

addOption

EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "addOption",
{Id:id, Window:window, Caption:caption, Func:func})

The addOption event adds a new entry to the tray (which contains the iView) options menu.

For multilingual application, the iView developer has to take care about the translation of the caption parameter.

Parameter Description

Argument

Type

Description

id

String

iView ID of the iView.

Window

Object

The HTML window object of the iView.

Caption

String

Title of the option. The title is displayed in the option menu of the tray

Func

String

JavaScript code that will be executed when the option is chosen.

Usage

<SCRIPT language ="JavaScript">

   ...

// For Java Portal components:

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", "addOption",

   {Id:"<%=componentRequest.getComponentContext().GetContextName()%>",
    Window:null, Caption:"New Option", Func:"alert('new option')"})

 

// For external iViews

  EPCM.raiseEvent("urn:com.sapportals:pagebuilder", " addOption ",
   {Id:null, Window:self, Caption:"New Option",
    Func:"alert('new option')"})

   ...

<SCRIPT>

Leaving content frame