cancel
Showing results for 
Search instead for 
Did you mean: 

pass parameters between two WD components

former_member317731
Participant
0 Kudos

Dear Experts,

I have a requirement to pass the parameters between two WD components . I have achieved it using the create_external_window popup call passing the URL but the requirement is to have on the same window. Is it possible i can pass the parameters using the Create_Window method for pop call. Please help.

Thanks and Best Regards,

Sahil

Edited by: Sahil@sap on Oct 6, 2010 8:40 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sahil,

Your Req can u be accomplished in this way...Let me explain with a Example

Iam Having Two Components Comp_A and Comp_B.Iam taking two parametrs in the Comp_A adding then and Displaying the result in the View Of Comp_B.

Comp_A

1.Create a View_A

2.Define the two attributes under a Node in component controller and make it as Interface Node and make UI Design with a button and these two attributes.

3.Emdeb the View_A in Window_A.

4.Create a Exit Plug for the window_A.

Comp_B

1.Create a view View_B.

2.Use the Comp_A in this componet by using component usages tab.

3.Map the Interface Node of Component Comp_A to the Context Of view View_B.

4.In INTI() Method Add this attributes.

5.Create a Start-Up Plug to the Window_B

Then come back to the Comp_A.

1. Use the Comp_B in this component by using component usages tab.

2.Go to Window_A ,right click ,u can embed the Window_B in this window.

3.Connect the Navigation Link ( Window_A :Exit Plug To Window_B: Starup Plug ).

Sharathmg
Active Contributor
0 Kudos

Best way to pass the data between components would be using the Interface controller. Make the context node as interface node and use it another com ponent.

Regards,

Sharath

former_member317731
Participant
0 Kudos

Hi Sharath,

Thank you for the response.

I have tried using your approach but the issue is I am not getting the data in the interface node in component controller.Please refer to the steps i followed and let me know If i am missing out anything.

1. I made the node in the first component as Interface node.

2. I am calling the Create_Window method for displaying pop up

3. In second component, I have defined the component usage for component 1.

4. I copied the context from 1st component in interface node to the controller context of second component.

5. But when i execute the application, the control goes to the method but when i am getting the values of the node, the node does not have any values.

Please suggest.

Thanks,

Sahil

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Make the interface node input element (Ext ) checked

former_member317731
Participant
0 Kudos

Dear Abhimanyu,

Thanks for replying.Actually I have already set the interface element checked in the context in the used component but still data gets lost when the control is in another component. please suggest.

Thanks and Best Regards,

Sahil

ChrisPaine
Active Contributor
0 Kudos

You need to ensure that the component usage in the second component refers to your instance of the first component - otherwise the WDA framework will just create a new instance of the first component.

The FPM gets around this by handling the component usages for you - but in your case you will need to manually pass the reference of the first component into the second and manually create the component usage using your existing reference.

[Thomas Jung's eLearning on plugs and component usage|http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/e0bf5a27-8b7f-2d10-758e-9bc403e5e6e9] may help you understand a little more about what component usages are and why you need to set them - especially in the example you have given.

Generally you would make component 2 a used component of component 1 and then launch that instance of component 2 in your new window rather than making component 1 a used component of component 2 and trying to pass data that way

Hope this make some sense to you!

Chris