cancel
Showing results for 
Search instead for 
Did you mean: 

Communication between two WebDynpro iViews

Former Member
0 Kudos

Hi All,

I have some doubts using WebDynpro portal eventing for communication between two WebDynpro iViews. Here is the code for my first Webdynpro iView

String name = wdContext.currentRecordsElement().getRecordId();

WDPortalEventing.fire("urn:abc.com/basicdata", "send", name);

and the code for my second iView is

WDPortalEventing.subscribe("urn:abc.com/basicdata","send",wdThis.wdGetReactPortalEventingAction() );

and in the method I have set the value for context attribute.

My question here is I am unable to get the value from the first iView to second iView, both are in the same page. I have given the value in input field and when I press the button in the first iView, the value to be displayed in second iView.

The project name is : LocalDevelopmentbasicdataabc.com

Here my doubt is what is urn or namespace name I have to give for WDPortalEventing.fire("urn:abc.com/basicdata", "send", name);.

Regards

Suresh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

WDPortalEventing.fire("urn:<b>abc.com/basicdata</b>", "send", name);

WDPortalEventing.fire("urn:<b>abc.com/basicdata</b>", "send", name);

The one which are in bold should match and that package can be anything.It need not mach with your project name. But both the iView should be assigned to the page. If you dod not assign them to a page then eventing will not be performed.

Refer to the following example for more information:

<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/5d/08f43cf1da7646a2b210a16321c669/frameset.htm">Code Example for Programming Portal Eventing</a>

Regards,

Jhansi

Former Member
0 Kudos

Hi Jhansi,

I have done the same. For both iViews I have given the same urn and I have assigned those iViews to the saem page, but the name is not displaying in second iView. Is there any changes to be done from server side for events. I have follwed the same example given by you.

Regards

Suresh

Former Member
0 Kudos

Hi,

You don't need to change anything in server side for events. I have done the same and its working fine.

Regards,

Jhansi

Former Member
0 Kudos

Thanks Jhansi, it's working for me also.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi EP Developer,

SAP provides some APIs for storing the data of 1 view in namespace & reusing it in othhr iview.

Use following 'Client Data Bag APIs' to server your purpose.

1. Store data from 1st iview :

<b>EPCM.storeClientData(nameSpace, name, value)</b> - saves data in value under a key.

name - Attribute name of type string.

value - Value to be stored as name.

2. Get the data back in 2nd iview :

<b>EPCM.loadClientData(nameSpace, name)</b> - Gets the data for the attribute 'name' in the nameSpace.

In youe case......

1st view.-

String name = wdContext.currentRecordsElement().getRecordId();

EPCM.storeClientData("urn:abc.com/basicdata", "NameAttrib", name);

< your code for portal eventing >

2nd view :

String name = EPCM.loadClientData("urn:abc.com/basicdata", "NameAttrib");

You have to use <b>Enterprise Portal Client Framework (EPCF)</b> services in your dynpro views.

Former Member
0 Kudos

Hi Suresh,

The parameter you are passing from the first iView to the second iView should be captured somewhere in the second iView.

Do one thing, in the eventhandler on the second iView create a parameter of String type, name it as "dataObject". Get the value of the dataObject and you will get a string like "name=<whatever>". Here, dataObject will hold the value of the parameter passed.

Hope this helps.

Regards,

Mausam

Former Member
0 Kudos

Hi,

Thanks for quick response, I have already done it. My problem is the value which I have appsed from first iView is not displaying in second iView.

Is that urn or namespace I have given is correct or not according to my project name.

Regards

Suresh

Former Member
0 Kudos

Hi Suresh,

URN is independent of Project name. The only thing is what URN you give at event raising time should match with the subscription.

Can you just try printing on the screen when you come to the second view rather than mapping a UI element just to check if the second iView is being called or not?

Regards,

Mausam