cancel
Showing results for 
Search instead for 
Did you mean: 

EPCF problems

Former Member
0 Kudos

Hi all,

I have two JSPDynpages, and I want to communicate them. I have done via EPCF. But they don't communicate. In one JSP I have subscribed to receive the event:

EPCM.subscribeEvent("urn:com.sap.bor:BUSxxxx","select", handleEvent);

And in the other one, I raise the event:

EPCM.raiseEvent( "urn:com.sap.bor:BUSxxxx","select", "spec code", "iViewSearchSpec" );

But the second one doesn't receive it. If in the same JSP I place the two lines, the event is received properly.

One colleague has told me that it is possible that the error can be done due to a lack of configuration.

In the page where the iViews are placed, i have changed the EPCFLevel from 0 to 2, and it doesn't work with any of them.

Is there any other value that I must check or configure?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi...

Isolation method is one of the iView Property..

Check the sending and receiving iView Property. If the isolation method is not embedded, give Isolation property as Embedded...

Here i gavecode for catching value from inputfield.. receiving in another input field..

<b>For Raising...</b>

<script language="JavaScript">

function raise() {

var funcName = htmlb_formid+"_getHtmlbElementId";

func = window[funcName];

var val = eval(func("inputid1")); --> sending input field id

EPCM.raiseEvent("com.company.name", "send", val.getValue());

}

</script>

<b>For Receiving..</b>

<script language="JavaScript">

EPCM.subscribeEvent("com.company.name", "send", subscribe);

function subscribe(event){

var val1 = event.dataObject;

var val = getHtmlbElement("inputid2"); -->receiving input field id

val.setValue(val1);

}

</script>

Regards,

Chinnadurai.R

[Points r welcome if helpful]

Answers (2)

Answers (2)

Former Member
0 Kudos

you pages may be isolated in seperate iframes, sometimes this doesn't work in child pages. you can try using

parent.EPCF.subscribeEvent( ... ) and

parent.EPCF.raiseEvent( ... )

Former Member
0 Kudos

Hi all,

Thanks for your replies... I have tried both of them and no one of them worked.

First solution (EPCMPROXY object): Receiver still without receiving the event (I tried this solution days ago, and I have tried it again...)

"Sender iView" has this code:

function launchEvent() {

EPCMPROXY.raiseEvent( "urn:com.sap.bor:BUSxxxx","select", "spec code", "iViewSearchSpec" );

}

"Receiver iView" has this code:

EPCMPROXY.subscribeEvent( "urn:com.sap.bor:BUSxxxx", "select", window, "handleEvent");

Both of them has included the file:

<SCRIPT src="/irj/portalapps/searchSpecs/scripts/epcfproxy.js"></SCRIPT>

If I place same lines in the same iView... it works... but in different iViews, it doesn't work. I think the problem can be something related with the isolation (both iViews and page has "URL" isolation mode)

Regarding the "parent.EPCF" solution, I think it is my lack of knowledge with javascript, but I have the javascript error:

parent.EPCF object doesn't exist.

Probably I'm not geting the parent object properly... am I?

Thanks a lot for your help!

Regards

Former Member
0 Kudos

Hi,

Try to embedded isolation mode.. Also if you still struggle with this, just send me email

Kind regards,

Ville

Former Member
0 Kudos

opps, i meant :-

parent.EPCM

Former Member
0 Kudos

Hi Ville,

What do you mean with "embedded isolation mode"? I'm not very expert with SAP portal...

Those days I won't be at the office... I will try both options as soon as I go back to my office.

Thanks for all!

former_member189428
Contributor
0 Kudos

hi GBS-SO Accenture

first u include epcf jar file

in epcf -


> one is raise event ---another one is subscribe event -


>

in producer u write like that -


>

<script>

function buttonClick()

{

var name = 'welcome ';

<!alert('hi how r u');>

EPCM.raiseEvent("urn:com.epcf.EPCFProducer", "clickEvent", name);

<!alert('hi how r u');>

}

</script>

in receiver u write like that -


>

<script>

function eventHandler(event)

{

myFormId.data.value=event.dataObject;

}

EPCM.subscribeEvent("urn:com.epcf.EPCFProducer", "clickEvent", eventHandler);

</script>

i hope it helps u

Former Member
0 Kudos

Hi all,

Thanks in advance to everybody for your help. I founded the problem (stupid problem)... In the begining I followed the SAP example of EPCMPROXY. In the example, there is only one part of the eventing (receiver or sender... I don't remember now)

After using that example, I create the other part of the "event comunication", the other iView. But in that iView, I didn't write next sentences:

var lnDotPos = document.domain.indexOf( "." );

if(lnDotPos>=0)document.domain = document.domain.substr( lnDotPos + 1 );

I have comented they, and now it is working correctly. I did 2.500 combinations of objects!!! and this was the problem... hours lost... It would be a nice advice in the SAP help to provide this information... use those lines in all the iViews that use this EPCMPROXY object.

Now the iViews can communicate... I can pass the values via the EPCM.storeClientData and EPCM.loadClientData.

I have another question, regarding how to set those values in the tableview cells...

I will open another thread to don't mix two problems in one.

Thanks again for your collaboration.

Former Member
0 Kudos

Hi,

Please award points for those answers you founded useful

Kind regards,

Ville

Former Member
0 Kudos

Done! I divide them between some helpful questions...

Thanks to all!

former_member189428
Contributor
0 Kudos

GBS-SO Accenture

1) Question Answer Store the Client Data

EPCM.storeClientData( 'urn:myOwnNameSpace', 'last_shopping_cart_add', lastEventID);

For loading the Client Data you try like that

var lastEventID = EPCM.loadClientData('urn:myOwnNameSpace','last_shopping_cart_add');

2) the second question you ask is

how set the values in table right

here i give the process

-


first you take the collection variable.

Iterator validItemsIterator = ShoppingCart.validItemsSet.iterator();

int rowIndex = 1;

while(validItemsIterator.hasNext()) {

String itemNameNow = (String) validItemsIterator.next();

above validItemslterator is a collection

now take that result in one variable ofter in result jsp where u want table view

u write u assign this variable.

JagadishBabu

former_member189428
Contributor
0 Kudos

GBS

try like this.let me know it is working or not

or other wise i forward my application to you.

JagadishBabu

Former Member
0 Kudos

Hi,

You might consider using EPCM Proxy instead:

http://help.sap.com/saphelp_nw2004s/helpdata/en/27/41b84033a8b533e10000000a155106/content.htm

Check in which mode you render your iViews as the problem might be as described in above doc that you're not referrning to "one level up" from your iFrame.

Notice also that it's important to include the epcfproxy.js file into your app.

Hope this is any help..

Kind regards,

Ville