cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer of context node data from one component to another

former_member672218
Participant
0 Kudos

Hello,

I would like to transfer context node data from Component A to component B. I tried all the steps that are mentioned in the forum but still the data does

not get reflected in the second component.

Please find below the steps that i have done so far.

Component A

1. Created a context node and marked the interface property in the same.

2. Updated the context node with data on action.

Component B.

1. Mentioned the component A in the "Used Components"

2. Mentioned the Component A and its interface controller in the Component Controller of B.

3. Mentioned the Component A and its interface controller in the View of component B.

4. Drag and dropped the context node from Component controller of A to Context in B.

5. Created table in component B and mapped the respective context node to the table.

In debugging ( In component B), i am not able to find the data in the context node.

Can you tell me what is the step i am missing?

Regards,

Venkat

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member672218
Participant
0 Kudos

Thanks again. So what i understand is that the data is to be flown automatically from Component A to B.

The context node gets filled in component A and my understanding is that being an interface node and since the mapping of component A is mentioned in component B the context node data is to be freely available in Component B without the need of any code logic. Hence that is why i mapped the table in component B to this context node but the data does not seem to flow into component B. I am left to wonder what exactly i am missing.

Any uggestion/solution will be of great help.

Regards,

Venkat

ramakrishnappa
Active Contributor
0 Kudos

Hi Venkat,

You are right... if you fill data in component A -- say in WDDOINIT( ).

Now, data should display in Component B - in your table the data should display

Hope this helps you.

Regards,

Rama

former_member222068
Active Participant
0 Kudos

Hi Venkat,

You have not implemented the code in component A.

That's it

Thanks & Regards,

Sankar Gelivi

former_member672218
Participant
0 Kudos

Hello Sankar and Rama,

Yes. I have not called any method. I am calling the first component A and that should trigger component B in a new window on click of a button in component A. I am trying to fill all the data into the context

node( Which is a interface node) in component A and on click of the button trying to read the context node data in component B.

I have written code in  WDDOINIT() method of component B where i am trying to read the context node data filled earlier. Is my approach correct or should i change the logic?

Regards,

Venkat

ramakrishnappa
Active Contributor
0 Kudos

Hi Venkat,

If you need to fill data when component A, gets instantiated, you need to write your logic to set data in WDDOINIT( ) of component A.

Now, In component B, you can read data in any action as Component A's context is already having data.

The WDDOINIT( ) method of component B is called first and then WDDONIT( ) method of used component A get called on instantiation.

So, set data in component A's WDDOINIT( ) method and read data in any method of Component B - not in WDDONIT( )

Hope this helps you.

Regards,

Rama

former_member222068
Active Participant
0 Kudos

Hi Venkat,

1. If you are writing code in Component B, yes this works.

2. If you have written code in component A, then follow the steps what I had mentioned.

  

Note: You can call only the custom interface methods in other components.

Thanks & Regards,

Sankar Gelivi

former_member222068
Active Participant
0 Kudos

Hi Venkat,

Steps seams to be correct. Check the logic once, whether you are able to fetch the data or not

for reference :

1. Defined component YSG_FACELESS in YSG_FACELESS_USAGE component

2. Define external context mapping between Interface controller of Faceless component and component controller of YSG_Faceless_usage.

3. Define internal context mapping.

4. Call the method of the component A

Note: Hope you should have missed calling the method.

Thanks & Regards,

Sankar Gelivi

ramakrishnappa
Active Contributor
0 Kudos

Hi Venkat,

The steps you have performed above are fine.

As you have mapped the interface node into your component B, you should be able to get the data of component A.

As you mentioned  : 2. Updated the context node with data on action.

The action is in component A, so how are you triggering / calling event handler method of that action in component B.

I suspect, the action of component A is not called.

You can try setting data of context node in view method WDDOINIT( ) of component A. Now, data of context node should be available in component B.

Hope this helps you.

Regards,

Rama