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

Similar Messages

  • How to call view-controller method out of componentcontroller

    Hello all,
    my component implements a component-interface with method BACK.
    Thus my componentcontroller has the interface Method BACK.
    When triggering BACK from an foreign component, the implementation within the componentcontroller is called. So far so good.
    Now I want to POPUP_AND_CONFIRM when BACK is hit. But this POPUP_TO_CONFIRM requires me to create an action. But I can't create an action within the componentcontroller.
    I could realize the POPUP_AND_CONFIRM within the components view. But how can I call a view-method out of the componentcontroller?
    Or does anybody have a better solution? (Maybe I could implement BACK within the view, but how to connect the componentcontroller-back-method with the views back-method?)
    Thank you very much in advance...
    Regards
    I. Durmaz

    You should never attempt to call view methods from outside the view.  It is possible to register popop event handlers to methods of the component or custom controllers.  From the online help:
    For a few special cases it is useful to register event handlers for component controllers or custom controllers on the button events of a dialog box. For these cases, a special POPUP_TO_CONFIRM attribute of type IF_WD_POPUP_TO_CONFIRM_N has been implemented in the IF_WD_WINDOW interface. This interface provides precisely the methods with which event handlers for component and custom controllers can be registered on events of the dialog box.
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/47/b9487e01602fe2e10000000a42189d/frameset.htm

  • Call view's method from component_controller

    Hello,
    I need to call a view's method from a component controller.
    Does anybody know how this can be done?
    Thank you.

    Hello,
    Thanks for the info.
    In this case. If I have a button on my ALV that takes a user to a different view how would that work?
    Navigation is done using plugs. ALV is initialized in COMPONENT_CONTROLLER and it does no not have plugs. Would I have to create an object of a view where ALV is initialized and than call FIRE_TO_XXXXX_PLG method?
    Thank you.

  • Call View controller with some URL parameter

    Hi
    I have a 3rd party system which need to send some data to my CRM system.
    One approch which is being suggested is by sending data by URL parameter.
    I have made a new component for this and have provided the 3rd party with its URL .
    The issue with calling a view controller URL along with some specific URL parameters is that i am not able to access its parameters.when i call method GET_PAGE_URL from the DOINIT method of the controller it does not provide me with the parameter list .
    How can i access these URL parameters ?
    Regards
    Ajitabh

    HI,
    have a look at component CRM_UI_FRAME. In the page default.htm they extract URL parameters.
    You have got the REQUEST variable in your view controller as well.
    cheers Carsten

  • Call view of another WDA Component and pass the value to it

    Dear Experts,
    I have a wda component1 with window1 and view1
    wda1 has a node1 with one attribute carrid (no default value).
    view1 also has the same structure and is mapped with it.
    (here i have one input field of type carrid)
    This view will be shown in wda2.
    now i have wda2 with window2 and view2 with the same structure & names as above (node & attribute)
    But here the carrid has a default value of 'AA'(so that when view1 is displayed in wda2,data is passed from here wda2).
    in wda property->used components i have used wda component1
    in view property->used components i have used wda component1
    view2 has a viewcontainer.
    In window2, in the view container i have embedded the view1 of the wda1.
    In the component2 context node, the default value of carrid is AA.
    when i have executed the application of wda2, it was showing the input field of view1 of wda1.
    but it was empty ie., had no value (AA).
    Now My problem is if i have the value AA in wda2 for the attribute, how does it get passsed to wda1.
    Regards
    Sajid

    Hi Sajid,
    Let me first try to say as to what I thought you were trying to achieve.
    You have 2 components say SUB & MAIN. Now in both the components you are trying to display an input field on your layout. This input field is bound to an context attribute CARRID & you have given it an initial value in only 1 component. (MAIN component) Now within your component MAIN you have an VIEWCONTAINERUIELEMENT & you are trying to display the view from SUB within it. But you end up with the input field from your MAIN view displaying the default value as AA whereas the view from SUB displays a blank input field. You now want to be able to have this input field fetch the value from your MAIN component and get initialized. So if this is your requirement then you can continue reading below:
    1) When you create your context at component controller level in component MAIN you have a property for the node which says as: "Interface Node" Just checkmark this checkbox. When you do this you would be able to share the data within your context nodes across other components.
    2) Specify a default value of AA in the "Default Value" property of the attribute in component MAIN
    3) Now go to your other component SUB which you would like to also get initialised. Define a usage of your component MAIN within this component.
    4) Go to your component controller & create your context node & attribute with exactly the same names as how you had created in your MAIN component.
    5) Do a mapping between the interface controller of your MAIN component & the component controller of your SUB component
    6) You would be able to see that the appearance of the node has changed to an interface node. This means that your SUB component now has an exact replica of your MAIN components context data.
    Test your application after following all these steps & you should be fine.
    Regards,
    Uday

  • How to call view requests window from forms

    I have a custom form in which i am running a concurrent program using FND_REQUEST.SUBMIT_REQUEST. after I submit the request, I manually go to the view -> requests -> viewoutput to see the report output. Is there any function which can be used in the form to skip this manual step and go directly to the view requests screen?

    Hi,
    You can use fnd_function.execute to open any form from another form. For instance, using fnd_function.execute('FND_FNDCPQCR') should open the Requests form. You can play with the parameters of the form (or use a different function) until you get what you actually need.
    Hope it helps.

  • Calling a method in view from component controller?

    Hi,
    Is it posible to call a method that is defined in the Component Controller in the View?
    If it is posible please give some sample code how to call the method?
    Regards,
    Padmalatha.K

    Padmalatha, all the methods defined in a controller from 'Methods' tab are instance methods. An instance method defined in a component controller is callable from any view controller that holds a reference to the component controller.
    Defining methods between the tags
    //@@begin others
    //@@end
    is useful if you want to declare static methods.

  • Call a method in the view from Component Controller

    Hi Friends,
    I have written the code for calling the RFC in Component Controller.
    My requirement is to change the properties of UI elements in the view, if I get any exception while calling RFC.
    Can Call a method in the view from Component Controller.
    Regards,
    Lakshmi Prasad.

    HI,
    You can get the error message during the exception of calling RFC in view itself.
    Any way you may call the RFC at some action in the view only.
    Can you explain me what you are trying to do?
    Kind Regards,
    Mukesh

  • How to call Custom or Component Controller methods from View Controller

    Hy Guys,
    how do I call Custom Controller or Component controller methods from a View or Context Controlller?
    thanks in advance
    Jürgen

    Hi Juergen
    Yes it is possible, pls follow the below approach to access the component controller in context node class
    1) since the standard component controller class is protect variable , declare a variable of type component controller in your controller class.
    say for example the public variable you declared is  g_comp_controller
    2)  now redefine the controller class method WD_CREATE_CONTEXT  and add the below lines of code
       g_comp_controller ?= me->comp_controller.
    3) go to context node class  (CNXX)  there declare the varaible which of type controller class (IMPL)  as public variable, for example g_owner
    4) redefine the method  IF_BSP_MODEL~INIT  and write the below code
         CALL METHOD super->if_bsp_model~init
        EXPORTING
          id    = id
          owner = owner.
      g_owner ?= owner.
    5) now the variable   g_owner  that is declared in  (CNXX)   contains reference to your controller class
    6) in  on_new_focus  method access your component controller in the below manner and access the entities also.
    DATA: lv_owner                    TYPE REF TO xxxxx_impl,  " Implementation class
                 lr_comp_cont                TYPE REF TO xxxx_bspwdcomponen_impl, " component controller class
                 lv_entity type ref to cl_crm_bol_entity.
    lv_owner ?= g_owner.
    lr_comp_cont    ?= lv_owner->g_comp_controller.
    IF lr_comp_cont IS BOUND.
       lv_entity ?= lr_comp_cont->typed_context->mdfcampaign->collection_wrapper->get_current( ).
    now lv_entity contains the value of component controller context node.
    Thanks & Regards
    Raj
    Edited by: bmsraj on Sep 27, 2011 3:28 PM

  • 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

  • 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.

  • 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 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

  • WD ABAP: call dialog window from component controller method

    Hi all,
    I need to call a dialog box from a method in the component controller. It would be helpful if u could post the code too.
    Thanks,
    Sravanthi

    Hi Maksim,
    this is the code i wrote:
    DATA: api_component  TYPE REF TO if_wd_component,
          window_manager TYPE REF TO if_wd_window_manager.
    api_component = wd_this->wd_get_api( ).
    window_manager = api_component->get_window_manager( ).
    wd_this->window = window_manager->create_window(
               window_name = 'OPTIONWD'
               close_button = abap_false ).
    wd_this->window->open( ).
    When i test it, this is the error i get.
    "An Instance of the View OPTIONWD Already Exists in the Component"
    how do i correct it?
    Thanks,
    Sravanthi

  • 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.

Maybe you are looking for

  • Partial Quantity and Line item not showing in MIGO

    HI All, My User create STO and after save it is automatically created OBD and PGI through BARCODE now problem is at the time MIGO it is take partially quantity.when i going to do manually rest quantity it is not showing all line items. Issue 1. It is

  • Apple TV across subnets

    Hi, Our marketing department would like to setup TVs at our branch offices and push information to some AppleTV boxes at each branch office. Each branch office is on a separate subnet (192.168.x.x) The Mac which will control these devices is located

  • Microsoft Word 2008 and Snow Leopard

    I updated word to 12.2.3? whatever the latest version is. Word cannot open some docx files I created in Word (windows version 2007). Is opens alot of other documents ok, but randomly some files it just locks up and freezes. I have to "ignore or repor

  • FK08 Customising

    Dear All, In FK08 we approve the vendor master data changes by clicking on the tab 'changes to sensitive fields', then  further digging inside we could see a detailed view of the actual changes.Now would it be possible to display all these changes on

  • Adobe Flash Builder 4.5.1 Premuim Download

    I have a serial for Adobe Flash Builder 4.5.1 Premuim. Where can i download that installation?