cancel
Showing results for 
Search instead for 
Did you mean: 

Passing values between components

Former Member
0 Kudos

Hi all,

I have two components component A (<b>contains a view View1</b>) and component B. I want to pass values between them without using context mapping.

I added Component A as a used Webdynpro Component in Component B. I <b>embeded View1 in a window in component B</b>.I pop-up the window and I want to return a value to component B. I don't know how to pass a value back to Component B.

Any help would be rewarded accordingly.

Subu.

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

HI,

First of all I just want to remember passing values through conext mapping is more efficient. Anyhow without context mapping you can exchange information using methods(just like any other programming language). Define a method in component A <b>(used Wd Component)</b> with the signature

<i>dataType returnValue <methodname> (dataType arg1,dataType arg2 ,dataType arg3,....)</i>. Call this method in View1.

You can use/call it in component B. Since it the method is availabe in Component B, you can use this any of the views of component B.

regards,

Siva

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi all,

Thanks for all your replies. It was useful. I have awarded points as promised.

I used eventing to passing values.

Regards,

Subu.

Former Member
0 Kudos
former_member751941
Active Contributor
0 Kudos

Hi Subra,

Check this thread.

Regards,

Mithu

former_member365727
Active Contributor
0 Kudos

Hi,

In the Component Controller of Comp A, raise an event.....catch this event in Comp B.

Data can also be passed using events.

Good approach is to have context mapping or method invocations.

Raising events will be useful, when data needs to be passed from one DC to another DC.

Regards

Srikanth

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Subu,

the Web Dynpro Java programming model provides the following techniques for inter-controller and even inter-component data transfer:

- <b>Context mapping</b>, primarily used to feed the UI/view-controllers as data-sinks with data stored in data-sources originating in component, custom controllers, other components, models. Context mapping can also be used to share native Java objects among different controllers.

- <b>Method invocation</b> with paramater transfer. Define methods in IPublic-API of component and custom controllers to be invoked by other controllers in the same component. Or expose methods in IExternal-API of component interface controller to be invoked by a controller of the embedding component.

- <b>Navigation Plugs</b>: You can pass parameter values with navigation links. Define one ore many parameters in inbound-plugs and in the corresponding outbound plug event handlers.

- <b>Serverside Eventing</b>: By adding event parameters you can pass values, objects etc. from an event-source to an event-sink across controller and even component borders.

Regards, Bertram