cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger an event in app2 from app1?

siongchao_ng
Contributor
0 Kudos

Hi all,

Is there a way for me to trigger an event in another application from my current application? Example: a button in my current view1 in zcomponent1 action is to fire up the action of a submit button in view2 of zcomponent2?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

You can add all the code on the press of the button in zcomponent2 in the method of the component controller of zcomponent2.

Then declare the usage of zcomponent2 in zcomponent1. Now call the same menthod in the button in Zcomponent1, which u are using in the button of Zcomponent2. make sure that the interface flag is checked for the component controller method to call it in another component.

Regards

Vishal Kapoor

siongchao_ng
Contributor
0 Kudos

Hi Vishal,

According to you:

"You can add all the code on the press of the button in zcomponent2 in the method of the component controller of zcomponent2.

Then declare the usage of zcomponent2 in zcomponent1. Now call the same menthod in the button in Zcomponent1, which u are using in the button of Zcomponent2. make sure that the interface flag is checked for the component controller method to call it in another component."

Now how do I call the same method in the button in Zcomponent1? I already embedded zcomponent2 inside my zcomponent1. I used code wizard (method call in used controller) but unable to find the zcomponent2 in it.

*Note: In Zcomponent2 is a button which call the method abc in Zcomponent2 component controller (is ticked in interface checkbox)

What else have I missed?

Former Member
0 Kudos

Hi,

go to zcomponent1. go the the desired view where u want to call this method. Under the properties tab, click the button "create controller usage" and select the Zcomponent2. Now when you will go to code wizard, you should be able to see the method.

Regards

Vishal

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Are these two separate Apps or just two separate components in one app? If the later than Vishal's suggestion of component usage interaction is certainly the better approach than portal eventing. I guess we really need to know more details about your situation.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Yes you can if you use the NetWeaver Portal or NetWeaver Business Client. You can create iViews for both applications and place them together into one portal page. You can then use the Portal APIs to trigger a Portal Event that can communicate (via JavaScript) between these two Web Dynpro Applications.

http://help.sap.com/saphelp_nw70ehp1/helpdata/en/0e/a1e94205045604e10000000a155106/frameset.htm