cancel
Showing results for 
Search instead for 
Did you mean: 

how to call method in view from controller ?

Former Member
0 Kudos

Hello Friends,

I want to call a method in view from controller ? how to do so ?

OR how I can access the context of view in the controller ???

Regards,

Edited by: Shah H on Feb 17, 2009 4:48 PM

Edited by: Shah H on Feb 17, 2009 5:22 PM

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi

Refer this thread...

It may help u...

Regards,

Rohit

Former Member
0 Kudos

hi,

if you want to access component controller's method's in view then use the following coding

wd_comp_controller->method name().

but the back navigation that is a method from view cannot be called into component controller.

2.if a context node is created in component controller then the data in the node gets shared whereever you drag and drop the context in view but reverse mapping from view to component controller is not possible as whatever context or methods are created in view they are local to the view.

Former Member
0 Kudos

Hello,

1) To call a method from component controller in the view use:

 WD_COMP_CONTROLLER->method();

You can get more help about this in [Web Dynpro Runtime APIs|http://help.sap.com/saphelp_nw04s/helpdata/en/61/497941761b070de10000000a1550b0/frameset.htm]

2) You can't use a view context in the component controller, declare the context in the component controller and in your view use a mapping to this.

Regards.

arjun_thakur
Active Contributor
0 Kudos

Hi,

I want to call a method in view from controller ?

It is not possible to call view's method from component controller.

how I can access the context of view in the controller ???

You can't access the context of view in component controller unless they are mapped together. To map them create context in component controller and then go to context of view controller and drag & drop the context nodes which you want to map. Now you can access these context in view as well as component controller.

I hope it helps.

Regards

Arjun