cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Data Back from a WebDynpro App to a Portal App

MVar
Explorer
0 Kudos

Hello all,

We have an iView in the portal that has a link to a webdynpro application. When the link is clicked, it opens the webdynpro app in a new window. When a user selects data on this window and clicks a button, I want that data selected transferred to a specific field on calling window.

Prior to using webDynpro, we were able to do this by using the code below on the called page.


<SCRIPT language='JavaScript'> 
function SelectUser() {
   var selectedUserAdmcd=document.all["EMP_ADMCD_RET"].value;
   window.opener.document.forms[0].ADMIN_HR_CODE_NEW.value=selectedUserAdmcd;	
}

Any suggestions will be appreciated.

Thanks,

Mike

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Mike,

The SAP Enterprise Portal 6.0 supports client-side eventing. I dont thhink you cannot write Java Script code in a Web Dynpro application, a Java wrapper enables you to implement portal eventing. You can subscribe to and unsubscribe from specific portal events. This means that the SAP Enterprise Portal can react to an event that is triggered by a Web Dynpro application.

Sample code for the same

In the sender application, On action of the button click event.

String parm=wdContext.currentContextElement().getInput();

WDPortalEventing.fire ("urn:com.sap.tc.webdynpro.example.portaleventing", "Event Name ", parm);

In the listener application

In the Init method subscribe the portal event

WDPortalEventing.subscribe("urn:com.sap.tc.webdynpro.example.portaleventing","Event Name ", wdThis.wdGetReactPortalEventingAction() );

Create an action ReactPortalEventing. Add the parameter data of type java.lang.String.

wdContext.currentContextElement().setOuput(dataObject);

The value of the element Input recieved in the Sender application will mapped to the element Output of the listener application.

Regards,

Srivathsan

MVar
Explorer
0 Kudos

Hello Srivathsan,

Thanks for your reply.

I think I should have been more specific. The sending portal app is not an iview but a regular JSP page (PCR page) which does not support portal eventing.

Inserting JavaScripts into the WebDynpro project is what is ideal, but I've read that there is no way to do it?

What do you think?

Best regards,

Mike

Former Member
0 Kudos

Hi Mike,

I dont think you can insert java scripts in Webdynpro.

Srivathsan.K