Hook methods in component controller vs hook methods in view controller

Hi,
I want to know how WDDoInit in component controller differs from the same in view controller.
How the lifecycle flows in both controllers?
Eg. if i create a method intialize() in both component  & view controllers and if i called initalize method in view, which one will be called?
Need to know how the flow works.
Regards,
Manoj

Dear Manoj,
Please check if it is helpful.
The order of execution of standard hook methods when a WDJ application is called the first time is as follows:
1. Component Controller DoInIt()
2. View Controller DoInIt()
3. Interface Window Controller
4. Component Controller DoBeforeNavigation()
5. Component Controller DoModify()
6. Component Controller DoPostProcessing()
After this, if you navigate to some other view, then the order of execution of methods of that New view will be:
1. Component Controller DoBeforeNavigation()
2. New View DoInIt()
3. New View onPlugfromFirstView
4. Component Controller DoModify()
5. Component Controller DoPostProcessing()
Then, if you again navigate back to the first view, then the order of execution of methods is:
1. Component Controller DoBeforeNavigation()
2. New View onPlugfromNewView
3. Component Controller DoModify()
4. Component Controller DoPostProcessing()
Webdynpro - Sequence of Execution
Thanks & Regards,
Patralekha

Similar Messages

  • Can we get  reference of WD component in custom class of enhanced View cont

    Dear Member,
    We are enhancing WD component. We need to get a reference of WD component in custom class of enhanced View controller (post exit) so that popups can be triggered or URLs can be called?. How should we get reference of WD component? I need to know cons of our approach.
    ...Naddy

    Hi,
    Create one static attribute in your custom class with type ref to of your component and populate this attribute in webdynpro enhancement and then use this reference in your custom class.
    Regards,
    Pon Murugesh

  • Calling a method in the view controller from the component controller

    Hi
    Is there anyway to call a method in the view implementation from the component controller??
    Thanks
    jack

    Thanks for all your replies. I want this kind of a functionality because Im trying to invove a DC (Child DC) from a Parent DC such that the Child DC's view is displayed onto the view container of the Parent DC. I have embedded using 'interface view of a component instance' in the Parent Window and am able to create the component and set usage though the onPlugDefault of the Child View.
    But I observe that when i make a call from the parent, the flow is like this:
    1. The wdDoInit of the Child Component Controller gets triggered first.
    2. Then the wdDoInit of the Child's <b>VIEW</b> gets triggered
    3. and <b>THEN</b> the onPlugDefault of the Child Component Interface View
    What I had actually wanted was to Fire onPlugDefault where Im calling a method LoadData(), after which the Child DC's view must be triggered so it can display the fetched data.
    What is actually happening is the view gets displayed, but no data is displayed in the view.
    Right now I have just given a work around where Im triggering <b>LoadData()</b> of the <b>COmponent COntroller</b> from the <b>wdDoInit</b> of the <b>VIEW</b>.
    Is there a better way to do this? I find it strange that I have to load the Data from the view.
    Thanks
    Jack

  • Calling main controller method from component view

    Hi,
    Because i want to re-use certain views, i've created components of em so i can re-use them in several places within the same view. The problem is that i have 1 main component which has several methods calling webservices. I want the other components to be able to call the methods of the maincomponent. I tried adding the main component to the Used Web Dynpro Components of another component. Then i added the main component in the properties of the view but then it says: Cycle in component usage definitions.
    I can understand this because the main view creates instances of all other components, so the sub components cannot create the maincomponent again...but how do i then give a reference of the maincomponents controller to the sub components?
    Much thanks,
    Hugo Hendriks

    Hi Siarhei,
    The problem of creating a Java class is that there i dont have access to certain classes for example when there is something with a webservice, i want to send a message back like
    IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
         msgMgr.reportSuccess(message);
    In a seperate java class, i dont have access to the wdComponentAPI! The only thing i want is kinda like a ServiceLocator to call different webservices. I do check roles of the user logged in the portal and stuff like that....How do you normally implement something like this? I have several views which have to make use of the locator....
    I hope i dont need to create a seperate DC when i want to re-use a screen and want to call a service method of another class or so.........Sounds like much overkill for a screen with 2 inputfields and a button!
    Anoop, i tried adding the mainController to the searchComponent by adding it to Used WebDynpro Components and then I added the mainController in the properties of the searchView so i can make use of it. In the searchcode i now can use the maincontroller but i still get the compiling message: Cycle in component usage definition!
    best regards,
    Hugo

  • Call a view's method from Component Controller.

    Hi
    Is it possible to call a view's method from Component Controller.
    Regards
    Nikhil

    Hi Tummuru,
    I have created an event in Component Controller by the name toMenuView. Now I created a method in which this event is getting fired. Foll. is the code of the method.
      public void fireToMenuView( )
       wdComponentAPI.getMessageManager().reportSuccess("fireToMenuView");
       wdThis.wdFireEventToMenuView();
    Now I have created an event handler "handleToMenuView" in the MenuView and subscribed the event handler to the event in Component Controller.
    The control is reaching to the fire event in component controller but not to the Event handler in view controller.
    What am I missing.
    Regards
    Nikhil

  • Which method is invoked first when we create a component or view controller

    When we create a component controller & view, what method is invoked / initialized first in component & view.

    Hi,
    wdDoInit() will be called first.whenevr u invoke an application
    then the sequence of invokation is wdDoInit() of component
    controller and then wdDoInit() of view will be called
    Regards.
    Surender Dahiya

  • FPM : OVERRIDE_EVENT_GAF method of Component Controller

    Hello All
    I am not able catch the button evenet value in OVERRIDE_EVENT_GAF method of Component Controller.
    What i have done is
    1) Created FPM Application with Road Map 4 Mainsteps.
    2) In the First Road Map contains view,  having two buttons. On click of buttons need to hide MainStpes
    Example : On Click of Button1 need to show Step1 Step2 and Step3 means Step4 is hiding
              On Click of Button2 need to show Step1 Step3 and Step4 means Step2 is hiding
    3)For the above requirement In the View created two actions for two buttons. In Button1 action written below code.
    Code for Button1 Action in the View
    data: lo_fpm type ref to if_fpm,*lr_event type ref to cl_fpm_event.
    create event
    lr_event = cl_fpm_event=>create_by_id(
    cl_fpm_event=>gc_event_change_step ).
    lo_fpm = cl_fpm_factory=>get_instance( ).
    lr_event->mo_event_data->set_value(
    iv_key = 'B1'
    iv_value = 'BUTTON1').
    4)  onclick of Button 1 when i m trying to get the value of B1 it is coming empty in the OVERRIDE_EVENT_GAF method of Component Controller. Expecting "BUTTON1"  written below code
    Code for OVERRIDEEVENT_GAF method of Component Controller_
    DATA: lo_fpm TYPE REF TO if_fpm,
    lr_event TYPE REF TO cl_fpm_event.
    get reference to FPM API
    lo_fpm = cl_fpm_factory=>get_instance( ).
    create event
    lr_event = cl_fpm_event=>create_by_id(cl_fpm_event=>gc_event_change_step ).
    lr_event->mo_event_data->get_value(iv_key = 'B1' ).
    5) Based on condition planning to hide the steps.
    IF BUTTON1
    Hide Step4
    IF  BUTTON2
    Hide Step2
    Please help how to get value in OVERRIDE_EVENT_GAF method of Component Controller onAction of Button
    Edited by: CarlinWilliams on Jun 17, 2011 1:56 PM
    Edited by: CarlinWilliams on Jun 17, 2011 1:57 PM

    Hi Carlin,
    You need to ensure that you raise the event:
    e.g. here I raise an event to pass some data from an org chart:
    lo_event =
         cl_fpm_event=>create_by_id( zpa_os_org_struc_flex_n_assist=>c_island_nav_up_requested ).
      lo_event->mo_event_data->set_value(
               iv_key = zpa_os_org_struc_flex_n_assist=>c_node_selected_for_nav
               iv_value = ls_nav_node ).
      wd_this->ao_fpm->raise_event( lo_event ).
    Then you need to read the event. In the OVERRIDE_EVENT_GAF method you can read the event by referring to
    io_gaf->mo_event
    e.g.
    io_gaf->mo_event_data->get_value( exporting iv_key = zpa_os_org_struc_flex_n_assist=>c_node_selected_for_nav
                                              importing ev_value = ls_node_detail  ).
    let me know if you need any other help/explanation,
    Cheers,
    Chris

  • Calling view controller method from component controller method

    Hi,
    Is there any way to call view controller method from component controller method?
    Thanks,

    Hi Khandal.
    You should not make you component controller dependent from a view controller.
    But what you can do is to define an event in the component controller. The view
    controller can register for this event.
    In the stage where you currently want to call the view controller method just fire
    the event. In the event handler method in the view controller you can call the
    method then.
    Why do you need to call a view controller method? Can you give more details
    about the scenario?
    Cheers,
    Sascha

  • Calling view method from component controller

    Hi Experts,
    How to refer a view method from component controller?

    if you have the view Instance, then you can call using the view instance. But this is not the correct apporach.

  • Call methods from view controller to another (enhanced) view controller!

    Dear All,
    Is it possible to use/call methods from view controller to another (enhanced) view controller? Iu2019ve created a view using enhancement in standard WD component. I would like to call one method from standard view controller in the enhanced view controller.
    Is it possible to include text symbols as enhancement in standard class?
    u2026Naddy

    Hi,
    If you have just enhanced an existing view then you can call the standard methods in one of the new methods which you will create as part of enhancement.
    If you have created a totally new view using enhancement framework option ( Create as Enhancement ) then in this new view you won't be able to use existing methods in other view as a view controller is private in nature. So all the view attributes, context nodes and methods are Private to that view only.
    Regarding text elements, I guess adding a new text element is just a table entry in text table and is therefore not recorded as enhancement.( Not very sure about this, need to double check )
    Regards
    Manas Dua

  • Pre,Post,OverWrite Exit for web dynpro ABAP methods of component,view

    Hi,
    my question is i have created overwrite exit for method of component controller in one enhancement implementaion say ENH1, and i also created overwrite exit for same method in another enhancement implemenation say ENH2, it means i have two different implemenations now, 
    My questions here is, will both Enhancement implemenations will "execute", if yes in what order..
    Please clarify.
    Thanks.

    I'm afraid the information that Manas gave you is incorrect.  In an overwrite method, the enhancement completely overrides and replaces the original method.  Both versions are NOT executed.  This is the risk you run with the Overwrite enhancement - you are choosing to completely replace the SAP delivered logic. 
    From the Online Help:
    The overwrite exit method takes on the signature of the original method and overwrites it.  This means that an overwrite exit is executed instead of the original method.
    At runtime only one overwrite exit can be active. If several overwrite exits are active, a runtime error occurs.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/dc/e6ba426b81da11e10000000a155106/frameset.htm

  • How to call another view controller's method from a view controller?

    Hi,
    Iam new to webdynpro . so pls clarify my doubt.
    How to call another view controller's method from a view controller in the same Web Dynpro Component?
    Thanks,
    Krishna

    Hi,
         The methods in a view are only accessible inside same view. you cannot call it outside the view or
         in any other view although its in same component.
         If you want to have a method in both views, then create the method in component controller and
         from there you can access the method any where in whole component.

  • Call method with an argument from another view controller

    I have a UIViewController MainViewController that brings up a modal view that is of the class AddPlayerViewController. When the user clicks 'Save' in the modal view I need to pass the Player data (which is a Player class) from the modal view to the MainViewController in addition to triggering a method in the MainViewController. What's the best way to accomplish this? I'm new to cocoa and have only tried using delegates and some ugly hacks to no avail.
    Thanks for the help.

    If I understand correctly, you have:
    1. A model object, Player.
    2. A top view controller, MainViewController.
    3. Another view controller, AddPlayerViewController, which MainViewController displays modally.
    I'm guessing that AddPlayerViewController creates a new Player object and lets the user set its values, and you need a way to get that new Player into MainViewController once they're done.
    So, here's what I'd do:
    1. Create an AddPlayerViewControllerDelegate protocol. It should declare two methods, "- (void)addPlayerViewController:(AddPlayerViewContrller*)controller didAddPlayer:(Player*)newPlayer" and "- (void)addPlayerViewControllerNotAddingPlayer:(AddPlayerViewController*)controll er".
    2. Add an attribute of type "id <AddPlayerViewControllerDelegate>" called delegate to AddPlayerViewController. Also add a property with "@property (assign)" and "@synthesize".
    3. Modify AddPlayerViewController so that if you click the "Save" button, addPlayerViewController:didAddPlayer: gets called, passing "self" and the new Player object as the two arguments. Also arrange for clicking the "Cancel" button to call addPlayerViewControllerNotAddingPlayer:.
    4. Modify MainViewController to declare that it conforms to AddPlayerViewControllerDelegate. Implement those two methods (addPlayerViewControllerNotAddingPlayer: might be an empty method if you don't want to do anything).
    5. When you create your AddPlayerViewController, set its delegate to your MainViewController.
    If you need more detail, let me know what parts you need me to elaborate on.

  • I have an ipod classic 160gb and i also have the dock to connect it to my TV  using composite cables. I would rather use component then the composite cables. Does Apple sell a component connection to hook up my ipod to hook up to my TV?

    I have an ipod classic 160 GB and I also have the dock to connect it to my TV with composite cables. I would like to hook it up but using component av cables. Does Apple sell a component connection to hook up my Ipod to my TV?

    Yep, part number MB128LL. Got it from this KB page: http://support.apple.com/kb/ht1454

  • How to get time spent in the repaint(long delay) method of component?

    Hi,
    I'm trying to get the time spent in the repaint method of Component. I tried to surround the method with time information:
    long time = System.getTime();
    component.repaint(400);
    time = System.getTime() - time;
    System.out.println("Time spent in repaint is: " + time);
    But, the method seem to return about immediatly after call, whereas the display do not seem to be completly redrawn. I think that this is because repaint method is done in a separate thread....
    I thought to catch the event that could be thrown when redrawn is completed but could not find this event....
    Do you have an idea how I could perform this?
    Thanks a lot
    Tanguy

    repant() posts an event to the Event Queue so that sometime soon the component's paint() mehtod will be called. It will be called by the Event Thread.

Maybe you are looking for

  • Moving data from DSO to cube

    Experts, We are in a situation where we might have to move data from cube to DSO. We doing POC and finding that even if DSO is set to overwrite, the data is summing up for same billing document. I would like to know: 1) is there any o

  • HH3 Type A can't tell the time

    Currently on HH3 number five, this one is Type A and has been running for about a week with reasonably consistent speeds until this morning when it had dropped again when I tried to restart it nothing happened.  Tried switching on/off still nothing j

  • Macbook Pro. What cable do i need to connect my monitor?

    Hi, I have a new Macbook Pro 15". I want to connect to my Samsung T220 monitor. It just plugged straight in to my OLD Macbook Pro. I am a designer and need best colour etc. Which cable / connector do I need???? Thanks R

  • MBP Time Machine backup can't be correctly recovered.

    Hello, I would be very grateful for some help. I try to describe what happened as best I can below: - I accidentaly deleted a neccessary file for the Computer to reboot and function properly. I used an XQuarks Software, a Wine wrapper that runs X 11

  • Bitmap Fill is not working as thought

    I am working on a simple target game. I have a class created that inherits from Sprite called TargetSprite. TargetSprite creates a resize matrix, sets beginBitmapFill, sets the line type, then draws a circle, then ends the fill. The problem is that i