Skip to Content
avatar image
Former Member

Methods in the Component controller

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Jul 29, 2008 at 12:54 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 12:51 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2008 at 01:21 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 30, 2008 at 09:09 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded