cancel
Showing results for 
Search instead for 
Did you mean: 

EPCM Error

Former Member
0 Kudos

Hi,

i have the following error:

EPCM not defined.

I create link in HTML page using the EPCM.doNavigate API and run this page in EP 6.0.

Someone can help me?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Stefano,

in order to get some useful help it's essantial that you provide more precise information.

How do you call the HTML page? In an URL iView?

Or does the HTML page lie on a different server in a different domain?

Maybe have a look here:

Former Member
0 Kudos

Hi Karsten,

I have this problem: create a link from custom iView to a page insert in the Second Level Navigation.

I have write the following code:

public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)

{

IPageContext myContext = PageContextFactory.createPageContext(request, response);

if (myContext == null) {

System.out.println("htmlb service did not start up as expected.");

}

Form myForm = myContext.createFormDocument("First Experiment");

String url ="ROLES://path to my page";

Link link = new Link("myLink");

link.setTarget("_TOP");

String navigation = "EPCM.doNavigate('" + url + "',2)";

link.setOnClick(navigation);

myForm.addComponent(link);

myContext.render(myForm);

}

When i click the link this Internet Explorer error occurred:

Object Not Found.

Can you tell, step by step, how can create the link to a page on the second level navigation?

Thanks in advance.

Former Member
0 Kudos

Hi Stefano,

change line

"link.<b>setOnClick</b>(navigation);"

to

"link.<b>setOnClientClick</b>(navigation);"

<i>(probably include a "javascript:"-prefix, too)</i>

"link.setOnClientClick<b>("javascript:"</b> + navigation);"

This should resolve the issue.

SetOnClick is executed on the server (i.e. the portal), whereas SetOnClientClick is executed on the client.

As you want to perform a JavaScript call, this needs to be done on the client side.

Good luck,

Dominik

Former Member
0 Kudos

Hi Dominik,

thank you very very much for your answer.

Unfortunately the method SETONCLIENTCLICK there isn't in the library that I imported(import com.sapportals.htmlb.Link;).

Know you where I download this library?

Regard

Former Member
0 Kudos

Hi Stefano,

this is strange. I just checked in the javadoc that comes with the PDK business package and it shows the following method:

<b>setOnClientClick</b>

<i>public void setOnClientClick(java.lang.String onClientClick)</i>

set a Javascript fragment that is executed when the user clicks on this button

<i>Parameters:</i>

onClientClick - the Javascript

The complete classpath for "my" Link class is "com.sapportals.htmlb.Link", so we should be talking about the same...

My Eclipse also says, the method is there (with its "intellisense" box).

Could you please double-check this on your PC?

Regards,

Dominik

Former Member
0 Kudos

Hi Dominik,

I have checked in my documentation Library and I find this method under

import com.sapportals.htmlb.Button while under

import com.sapportals.htmlb.Link there isn't;

there isn't in the intellisense box too.

Can I use this method?

regards

Stefano

Former Member
0 Kudos

Hi Stefano,

this is strange... are you sure, you are using the EP6 HTMLB libraries?

Anyway, for testing and learning purposes, you can try the same with an htmbl button as well as with a link. Just create a button object, give a meaningful text and set the setOnClientClick() to the value above.

If this codes compiles without problems, try if it works. If you should have trouble at that time, please do not forget to provide the following here in SDN

- the relevant part of your source code

- the relevant part of the generated iView HTML code (the lines around the button in the html source)

Good luck,

Dominik

Former Member
0 Kudos

Hi, Dominik

I check again and I discovered that I use the EP5 HTMLB libraries so I get the correct libraries and now I can use the setOnClientClick() method with LINK.

But....

...when I click on the link, the page is load while the Top level Navigation not changed. Why?

Can help me????

Thank in advance.

Former Member
0 Kudos

Hi, Dominik

thank you very very much for you answer.

My work is OK now.

I write wrong path to the page.

Thanks.

Regards,

Stefano

Former Member
0 Kudos

Hi Stefano,

great to hear this. So I understand correctly, that your original problem was caused by having used the wrong version of the library?

I suggest, that you then mark your question as answered - any maybe think of using that yellow star icon for saying "thanks" the SDN way

Bye,

Dominik

Answers (1)

Answers (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Stefano,

a) Is it possible that your content lives in it's own iFrame? In this case, just use EPCMproxy (see pages 20-22 in https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/enter... portal client.pdf ).

b) EPCF is activated? (See pages 5 & 22/23 in the document given above.)

Hope it helps

Detlev