cancel
Showing results for 
Search instead for 
Did you mean: 

Component usage

Former Member
0 Kudos

Hi expert,

i have created a web component which contain a tree .in this tree we have a TREENODE under which i have an action DBLCLICK.,that do some functionlity for this component..NOW i want 2 use this component in another web component..in sec componet i need the same action DBLCLICK ,means when i click on treenode ,there sud be some output.

please let me know how to do that..

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

check out this link. It shows how to use one component method's in another component.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2e71ce83-0b01-0010-11a4-98c28a33...

Thanx.

Former Member
0 Kudos

Hi Swati,

You can use action DBclick in another component if action DBclick is in the component controller. if it is so then follow this steps.

1. Click on the component name in which you want to add Your component.

2. Click on the used component tab. and in component name coloumn give any name ,in component coloumn give component name which want to add.

3. Now suppose you want to use DBCLICCK action in view then go to properties tab of view and add componet and interface controller.

4 . create a action for the treenode and in that action call DBCLICK method using cntr+F7 . select method in used controlled radio button. Now by using F4 select component name and method name.

I hope it helps.

Regards,

Rohit

Former Member
0 Kudos

hi rohit ,

thanks for your kind answer ,

i did as you said ,but when i click on a node of tree which i have created in first component.

it does not trigger any event in second component.

arjun_thakur
Active Contributor
0 Kudos

Hi Swati,

I don't think that using a component in another creates a problem in triggering an event. Just make sure the tree component (which you have used in another component) is triggering an event when you click on any node. Run that component alone, put a break point in the event handler method and check if it is getting executed..

I hope it helps.

Regards

Arjun

Former Member
0 Kudos

Hi,

For accessing the method of first component in second component u must have that method in component controller. So in the first component put that method in component controller.

Now suppose u have the first component C1 and second is C2. U have to use the method of C1 in C2. For this follow the followinig steps:

1. Double click on second component( C2 ) and under the component column write the name of first component( C1 ). Save the data.

2. Now go to your view context and click on controller usage button. Now select interface controller and save the data.

3. Now go the action in second component( C2 ). Here u have to call the method of first component.

For this go to Control Wizard and Select Method call in used Controller. Now here in component name select Your first component( C1 ).

There after u can select the method name also.

Thanks

Pankaj Aggarwal