cancel
Showing results for 
Search instead for 
Did you mean: 

Call view of another WDA Component and pass the value to it

Former Member
0 Kudos
273

Dear Experts,

I have a wda component1 with window1 and view1

wda1 has a node1 with one attribute carrid (no default value).

view1 also has the same structure and is mapped with it.

(here i have one input field of type carrid)

This view will be shown in wda2.

now i have wda2 with window2 and view2 with the same structure & names as above (node & attribute)

But here the carrid has a default value of 'AA'(so that when view1 is displayed in wda2,data is passed from here wda2).

in wda property->used components i have used wda component1

in view property->used components i have used wda component1

view2 has a viewcontainer.

In window2, in the view container i have embedded the view1 of the wda1.

In the component2 context node, the default value of carrid is AA.

when i have executed the application of wda2, it was showing the input field of view1 of wda1.

but it was empty ie., had no value (AA).

Now My problem is if i have the value AA in wda2 for the attribute, how does it get passsed to wda1.

Regards

Sajid

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Sajid,

Let me first try to say as to what I thought you were trying to achieve.

You have 2 components say SUB & MAIN. Now in both the components you are trying to display an input field on your layout. This input field is bound to an context attribute CARRID & you have given it an initial value in only 1 component. (MAIN component) Now within your component MAIN you have an VIEWCONTAINERUIELEMENT & you are trying to display the view from SUB within it. But you end up with the input field from your MAIN view displaying the default value as AA whereas the view from SUB displays a blank input field. You now want to be able to have this input field fetch the value from your MAIN component and get initialized. So if this is your requirement then you can continue reading below:

1) When you create your context at component controller level in component MAIN you have a property for the node which says as: "Interface Node" Just checkmark this checkbox. When you do this you would be able to share the data within your context nodes across other components.

2) Specify a default value of AA in the "Default Value" property of the attribute in component MAIN

3) Now go to your other component SUB which you would like to also get initialised. Define a usage of your component MAIN within this component.

4) Go to your component controller & create your context node & attribute with exactly the same names as how you had created in your MAIN component.

5) Do a mapping between the interface controller of your MAIN component & the component controller of your SUB component

6) You would be able to see that the appearance of the node has changed to an interface node. This means that your SUB component now has an exact replica of your MAIN components context data.

Test your application after following all these steps & you should be fine.

Regards,

Uday

shaik_sajid
Active Contributor
0 Kudos

Dear Uday,

Thanks.....you are Genius!!!!!!

Regards

Sajid

ashish_shah
Contributor
0 Kudos

Hi Uday,

I know this is an old thread , and asking question here may not be appropriate.

However since the question is related to the solution that you have proposed, i wanted you to take a look at my post in below thread :

http://scn.sap.com/thread/3198265

Regards,

Ashish Shah

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

Whenever you create a node in component controller, there is check box for interface node. Just select that check box and it will become an interface node. When you use this component with interface node in another component, then the interface node is available for mapping. Just map the interface node from first component to second component. The values will be transferred as you want.

Regards,

Runal