cancel
Showing results for 
Search instead for 
Did you mean: 

Methods in the Component controller

Former Member
0 Kudos

Hello,

When is better call a method in the component controller, than run only a viewu2019s method?

In other words, what kind of methods should to be in the component controller and what kind of methods should to be in the view?

Could you give me some examples?

Regards

Janeth

Accepted Solutions (1)

Accepted Solutions (1)

PradeepBondla
Active Contributor
0 Kudos

Hi,

All the methods which deals with business logic, calculations, repeated methods for all views will be written in component controller.

for example All the model related methods you will write in component controller.

Actually in view you should not write any method which deals with business logic,it should contain only presentation logic. you will just call the methods in component controller here.

you have to max utilize the existing methods doInit(), doModify() and also some actions like onSelect, onSubmit which deals with view controller.

PradeeP

Former Member
0 Kudos

Thanks both of you!

Answers (3)

Answers (3)

Former Member
0 Kudos

you can write all buisness logic method in component controller or also method which is common across the view.

in View you can write method only related to UI changes and action.

Former Member
0 Kudos

hi

The EventHandler methods like on Action<actionname>() and methods to fire plugs we will generally used in view controllers.

If we want to intialise any attributes we will do it in WdDoInit() method of view Controller.

Generally its not preferrable to write business logic which is used by many components like service contoller generated methods in a view.

Its a good way to use Service Controller methods like execute<bapiname> in Component Controller.

For Dynamic Generation of UiElements we will use the WdDoModifyView(..) we use it in View.

Regards

sowmya.

Former Member
0 Kudos

Hi,

Check these links

[Component Usage with Controller Access|http://help.sap.com/saphelp_nw04s/helpdata/en/eb/f712403dbedd5fe10000000a155106/content.htm]

[Controllers of a Web Dynpro Component |http://help.sap.com/saphelp_nw04s/helpdata/en/b9/b82c4142aef623e10000000a155106/content.htm]

Hope this would help you

Regards

Narin