cancel
Showing results for 
Search instead for 
Did you mean: 

Giving parameters from One Component to another Component

Former Member
0 Kudos

Hi,

i create two components. I call it A and B. Component A uses B like Used Web Dynpro Components. I start Component A and work in it. Then i want to start Component B with a parameter from Component A. I created a OutboundPlug in A and a InboundPlug in B and declared the parameter in both components.

I start the the link with:

wdThis.wdFirePlug.AOut(wdContext.nodeX.currentXElement().getString());

In the Component B i would like to read the parameter. I think i make this in the PlugEvent.

public void onPlugBIn(..wdEvent, java.lang.String number)
{

And here i dont know how to bind the parameter number to the Context. I declared a Model attribute i want to bind the number.

Can somebody please help me.

Thanks, Stefan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi stefan,

i believe there is no need to do the mapping of context attributes . Without that itself you'll get the parameter passed in the second component. the only thing is that the parameter passed in the outbound plug and that retrieved in the inbound plug should have same name and data type.

can you send me your project to my mail id rahul_thunoli@satyam.com , so that i can look into it. the same scenario is working fine for me.

regards,

rahul.

Answers (4)

Answers (4)

Former Member
0 Kudos

hi stefan

hope you have embedded the view from the second component into the window of first component making use of the option.

'Embed Interface view of the component instance' .

Now do appropraite mapping in the window diagram of the first view(where you create your outbound plug from the first view and also parameter to be passed. The creation of inbound plug has to be done seperately in the second component . Also create a parameter of the same name as you created in the outbound plug before)

After this on any action from the first view write the code that would trigger the outbound plug to the view in the second component. and in the inbouund plug event of the second view you'll get the parameter passed.

regards,

rahul.

Former Member
0 Kudos

Hi Rahul,

i embedded it with this option. And i made all plugs and parameters. You write about mapping in the first view.

Do i have to make a context mapping between my View of Component A and the InterfaceView of ComponentB?? I thaught i don`t have to make a mapping, because i overgive the parameters? What do you think??

Regards, Stefan

Former Member
0 Kudos

Hi Stefan

Try creating a inbound plug in the interface view of the embeded component.

From the diagram view map the outbound plug to the inbound plug you have created in the embeded component.

Regards

NagaKishore V

Former Member
0 Kudos

Hi NagaKishore,

shell i map the field i want to overgive?? I created a inbound plug in the interface view and a outbound plug in the view i want to start the interface view.

I create the interface view on Demand and it is not shown before i fire the plug! Could it be a problem with this??

Regards,

Stefan

Former Member
0 Kudos

Hi,

thanks for your answer. I tried this two things but nothing happened. Do you know where or how i can look for the parameter that were overgiving to the Component. Or can i bind an input field where i can look at the parameter? Thanks for your Helps.

Regards, Stefan

Former Member
0 Kudos

Hi Stefan,

Declare the parameter as number type String and while firing the outBound Plug by setting it as

name = wdContext.nodeX.currentXElement().getString();

wdThis.wdFirePlug.AOut(name);

And then in the inbound plug declare parameter with same name and type. Now retrieve the parameter as Rahul said.

Regards,

Jaydeep

Former Member
0 Kudos

hi stefan,

the value you passed from the first component will be there in the variable 'number' in your inbound plug event. you can set the model attribute as.

wdcontext.<yourmodelnoe>.current<yourmodelelemnt>.set<attributename>(number);

regards,

rahul.