cancel
Showing results for 
Search instead for 
Did you mean: 

I wanna call a method from componentcontroller

Former Member
0 Kudos

Hi experts,

I defined a method in the componentcontroller and I need to call this method from many views.If this is possible, how can I call it from any view? Can anyone give me an example code and explain it. Thanks for all responses

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Mehmet Targün ,

Its very simple .

1 ) I choose my component controller and I clicked in Method tab .

In methods I added my method

myNewMethod()

. I wrote code inside it .
2) Now let suppose I want use this on click on some button in my view .I just went to onAction of that button and I clicked On my

Web Dynpro codeWizard

( Ctrl + F7 ) . In wizard I clicked on second Option i.e. Method call in Used controller .
3) In Method call in Used controller option I choosed
Component name I used .Then Component Controller automatically appeared in
Controller used . When I clicked on Method .It show me

myNewMethod

in it .

I hope this is what you was looking for .

Cheers

Parry

Answers (1)

Answers (1)

former_member196517
Contributor
0 Kudos

Hi,

go to properties tab of your view and define usage of component controller

:-- and then go to any method of your view and click a button on mid top which generates code. You will find a window with lots of options select call metod of used component . Select your component controller there and your method.

:--simply go to your method and use like:

wd_comp_controller->method_name ( ). (ofcourse u have to add usage first in properties tab)

Thanks

Anuj