cancel
Showing results for 
Search instead for 
Did you mean: 

component usage

Carola1
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello

A component 'A 'has a tree.´

The second component 'B' does call a method with import parameter that should be filled dependent of the tree element that was clicked before in compA.

How do I get the information which element was clicked from Component A to Component B in the best way.

(context ? parameters?)

Thanks.

Carola

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Carola,

Create a context node as an interface node in the component controller of component A. Declare a usage of component A in component B. So the context node is accessible in component B. You can then map it in component B in the view itself. The component usage needs to be specified in the view also, other than having it at the component level.

This can also be achieved by having a component interface and an interface view with parameters in the plugs, but context mapping is a better way to do it.

Regards,

Nithya

Message was edited by:

Nithya S

Carola1
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Nithya.

Because the action that is performed in Comp B is triggered in the tree, isn't it like this, that Comp A is the main comp and therefore in CompA the usage of CompB has to be declared ??

Kind regards

Carola

Former Member
0 Kudos

Hi Carola.

The component that has your tree will be the main component. The one whose method needs to be called will be the using component. So that usage should be declared in the component that has the tree.

Regards,

Nithya

Former Member
0 Kudos

Hi Carola.

That is correct. You could define an interface method in componentB and when something is clicked in the tree you can pass the needed data or context element to the used component via this interafce method.

But Nithya's approach is also easy to implement.

Cheers,

Sascha

Message was edited by:

Sascha Dingeldey

Answers (3)

Answers (3)

Carola1
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Sascha.

could you please tell me more in details in which Controller I have to set the flag

INput-element (Ext.) for external mapping and where have I to define component usage and controller usage???

Componente A is my main component which uses CompB. Comp B should get data from CompA.

Thanks.

Carola

Former Member
0 Kudos

Hi Carola.

You have to set the flag in component B. Then define the same node in

component A. Define the component usage in component A. In the object

navigator go to the component usages node of component A and open all

subnodes.

Here open the interface controller of componentB. Add the controller usage of the

component controller of componentA by hitting the button at the top (Controller

Usage). Then you can drag the node of component controller (component A) to the node of the

interface controller (component B) and voila .. external mapping defined.

Hope this helps,

Sascha

Message was edited by:

Sascha Dingeldey

Former Member
0 Kudos

hi again.

I have forgotten some things

If there is no controller usage defined under the component usage right click on the component usage and choose create controller usage.

The double click the controller usage to see the things i mentioned above.

Cheers,

Sascha

Carola1
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello

just one more question to the interface method and context data.

I've shared the context node (interface controller) which contains the data that I need in Component B after clicking in the tree of the main Component A.

I fill the context in component A. Is it necessary to call SET_ATTRIBUTE in the interface method of Comp B to have the context data available.? Or does the transport work just via binding ?

Kind regards.

Carola

Former Member
0 Kudos

Hi Carola.

Via ecxternal mapping you only have to set the data in compA with the tree.

Cheers,

Sascha

Carola1
Product and Topic Expert
Product and Topic Expert
0 Kudos

thanks.

Carola