cancel
Showing results for 
Search instead for 
Did you mean: 

fire() and subscribe() not working

former_member187658
Participant
0 Kudos

Hi

I have a DC which contains 2 Applications, 2 diiferent components.There is a link in the first application's iview which opens the second application in the content area. I did this using WDPortalNavigation.navigateAbsolute(). Now i want to move some data from second application to the first application. For this i m using Subscribe() and Fire() method in both the iviews as follows:

in the sender (second) application:

WDPortalEventing.fire("urn:com.sap.try.cust", "Code", code);

in the receiver (first) application:

in it's wdDoInit() method:

WDPortalEventing.subscribe("urn:com.sap.try.cust", "Code", wdThis.wdGetReceiveCodeAction());

public void onActionReceiveCode(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String code )

{

//@@begin onActionReceiveCode(ServerEvent)

wdContext.currentContextElement().setCtx_BACode(code);

//@@end

}

the context attribute Ctx_BACode is mapped to UIElement for displaying.

When i run this application, i am able to move from first application to second application, but when i click to send the data to the first application, it doesn't go.

Could anybody please suggest a way about it?

Thanks & regards,

Anupreet

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hello Anupreet,

Did you check this ?

Best regards, Maksim Rashchynski

former_member187658
Participant
0 Kudos

Hi Maksim,

Thanks a lot. Yeh, it worked. The isssue was instead of giving string variable name as dataObject, i was giving my own defined name.

Thanks & regards,

Anupreet

Answers (2)

Answers (2)

Former Member
0 Kudos

hi

check whether action parameter is mapped to the portal event.

check whether the button preview is pressed in edit mode.

regards

saravana.

arun_srinivasan
Contributor
0 Kudos

hi anupreet,

check this link

http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/how to program portal eventing

hope this helps,

Regards,

Arun