cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript + EPCM

Former Member
0 Kudos

Morning,

How cud i use a function like window.open() in javascript to fire EPCM.doNavigate(url)?

I want to implement something like this:

when an iview loads on a page it shud auto open another small iview as a pop window.

I can do this with some url like http://www.google.com but want to open an iview with EPCM functionality.

Have any Ideas?

Thanks & Regards,

Peter.

Accepted Solutions (1)

Accepted Solutions (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Peter,

see http://help.sap.com/saphelp_nw04/helpdata/en/26/71c74030308431e10000000a1550b0/frameset.htm for the parameter list of doNavigate (it's the parameter "mode").

Hope it helps

Detlev

Former Member
0 Kudos

Thanks Detlev,

My problem is something like this:

I have added a new option in the tray of an iview..if i click that option a javascript function is invoked, iam trying to invoke another iview using EPCM.doNavigate(); in that javascript.

Once a user click that option it executes say myOption() function then how shud i open a new window ??<b>Using EPCM</b>.

Thanks.

I have posted another Thread <u>whatz wrong with this code</u> ..U have solved an issue of same kind...Iam sturggling to get it working even thought everything seems correct..cud U plz point me in right direction?

Regards.

detlev_beutner
Active Contributor
0 Kudos

Hi Peter,

I don't catch what's the problem - I pointed to the docs, just use doNavigate with mode=1 or mode=2!?

> I have posted another Thread

> whatz wrong with this code

Couldn't find it, would you provide the link?!

Hope it helps

Detlev

Former Member
0 Kudos

Thanx for responding!!

K here is the link for the thread:

Iam sorry for the confusion,ok i will make it simple:

How shud i invoke EPCM.doNaviagte(url) with out clicking anything.

EG:

windows.onload=myFunc;

myFunc()

{

Here i shud pop-up a window (infact an iview) using EPCM functionality.

}

The reason y i want to use EPCM is coz, itz an iview not just a general url.Had it been a general url..i cud have used window.open('url','myurl'); in the above function.

Please Post back if u still don't understand the problem.

Thanks.

Former Member
0 Kudos

hi Peter,

You can use the window.open() method also,as an Iview also has a URL which you can get when you preview it from the PCD.You can provide that URL and the pop up for that iView can be opened.

Regards,

Siddhartha

detlev_beutner
Active Contributor
0 Kudos

Hi Peter,

still, I don't know where the problem is, even if you are using EPCF.

myFunc() {
  EPCM.doNavigate("ROLES://portal_content/folder1/role1/workset1/iView1", <b>1</b>, "", "My external iView", 0, "", "");
}

Hope it helps

Detlev

Former Member
0 Kudos

Thanks ..I tried ur code..iam getting a javascript error..i need to tweak ur code..will post u back.

Did u see my other thread?Plz advise something!

Regards

Former Member
0 Kudos

Hi Peter,

I am relatively new to this SDN thing, and relatively new to the EP 6.0 as well. But I think i might have a solution to your problem.

Inside an iView, the window.onLoad & window.onUnload events will not work, as the Portal framework doesnt allow it to. Instead the portal has given EPCM events which handle the above two events.

Your code :

<body window.onLoad = "javascript:myFunc()">

<script>

function myFunc () {

alert("Something");

//Your code logic

}

</script>

My code that might work even for you :

EPCM.subscribeEvent("urn:com.sapportals.portal:browser", "load", myFunc);

<script>

function myFunc () {

alert("Something");

//Your code logic

}

</script>

Similarly, the window.onUnload event in standard javascript hs to be replaced with

EPCM.subscribeEvent("urn:com.sapportals.portal:browser", "unload", Your_Function_name);

Hope this was useful...

Thanks & Regards,

Navneet.

Answers (1)

Answers (1)

Former Member
0 Kudos

Don't know whether this one helps you or not.

href='javascript:EPCM.doNavigate(+page to navigate +)'