Fireing outbound plug of interface view from within component

Hi all,
is there a better way of firing an outbound plug of an wd component interface view than from within the interface view controller itself?
The problem is, that you easly get a cyclic reference if you evaluate inbound component plugs in the interface controller (usage from int view ctrl --> int ctrl needed) and then try to fire an outbound plug from this interface controller (usage comp int --> comp int view usage needed).
One workaround is to use some custom controller with usage of the interface view, but this doesn't seem to be a nice solution.
So is it possible to fire outbound comp plugs from, lets say the component controller - without any usage releation to the comp int view - instead, maybe via wdComponentAPI? If yes, could you provide a code snippet?
Thanks you and best regards,
Christian

Hi Christian,
this is not possible by using the public API only, i'm afraid. It is of course possible, if you decide to forget about the possible drawbacks of using methods and classes reserved for internal use. But you have to use it at your own risk. I hacked this together some weeks ago, don't know whether it still works
* Fires an outbound plug of an interface view with parameters.
* @param wdComponentAPI Component API "owning" the interface view.
* @param windowName Name of window
* @param plugName Name of outbound plug
* @param callerParameterMap optional Map of plug parameters.
public static final void fireOutboundPlug(
  IWDComponent wdComponentAPI,
  String windowName,
  String plugName,
  Map callerParameterMap)
  throws WDRuntimeException {
  // Find window requested
  IWDWindowInfo windowInfo = wdComponentAPI.getComponent().getComponentInfo().findInWindows(windowName);
  if (windowInfo == null) {
    throw new WDRuntimeException(
      "Can't find window: " + windowName + " in component: " + wdComponentAPI.getQualifiedName());
  // Get info of interface view
  IWDInterfaceViewInfo ifViewInfo = windowInfo.getInterfaceView();
  if (ifViewInfo == null) {
    throw new WDRuntimeException("Window: " + windowName + ", no interface view info found");
  // Find outbound plug
  IWDOutboundPlugInfo outboundPlug = ifViewInfo.findInOutboundPlugs(plugName);
  if (outboundPlug == null) {
    throw new WDRuntimeException(
      "The interface view: " + ifViewInfo.getName() + " has no outbound plug: " + plugName);
  // Parameter passing
  Collection plugParameters = outboundPlug.getParameters();
  // TODO make check optional, check caller map parameter keys against existing
  if (plugParameters == null || plugParameters.isEmpty()) {
    // No caller parameters allowed.
    if (callerParameterMap != null && !callerParameterMap.isEmpty()) {
      throw new WDRuntimeException(
        "The outbound plug: " + plugName + " has no parameters, callerParams must be empty/null.");
  // TODO This is a hack, use of internal WD runtime classes and methods (don't use productive).
  InterfaceView ifViewController =
    (InterfaceView) ((Component) wdComponentAPI.getComponent()).getController(ifViewInfo.getName());
  ifViewController.navigate(outboundPlug.getName(), callerParameterMap);
Please remember, that not everything which is technically possible, makes sense
Regards
Stefan

Similar Messages

  • Fire outbound plug of interface view controller?

    Hello Experts-
        In my WD project I have two apps A and B.
        I need to navigate from app A to app B.
        In the interface view controller of app A, I have created an outbound plug called GotoB.
        I determine the URL of app B using the WDURLGenerator and store that value in a string.
        In a view of the app A I have the code:
    <code>
    wdThis.wdGetAInterfaceViewController().wdFirePlugGoToB("URLtoB");
    </code>
        For some reason nothing seems to be happening when the event triggers in the view of app A that runs the above code. The view of app A just seems to refresh. The one thing that does happen is that on the refreshed view of app A if I click on the button to trigger this event again I get an 'app A has expired' WAS error.
        What am I missing here? How can I make the navigation from app A to app B work?
    Thank you,
    - Vik.

    Hi,
    well step by step:
    1) Create component Component1 (package="com.sap.sdn", window name = "Component1CW", View name="Conponent1CV")
    2) Create component Component2 (package="com.sap.sdn", window name = "Component2CW", View name="Conponent2CV")
    3) Create application "App1" (package="com.sap.sdn", Web Dynpro component="Component2", the rest - by default)
    4) In Component1CWInterfaceView create outbound plug "GoToComp2"
    5) In Conponent1CV add Component1CWInterfaceView as required controller
    6) In Conponent1CV add button and in action handler put following:
      public void onActionGoToComp2(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionGoToComp2(ServerEvent)
        wdThis.wdGetConponent1CWInterfaceViewController().wdFirePlugGoToComp2();
        //@@end
    7) In component Component2 add Component1 as Used Web Dynpto Component (name="Component1CU")
    8) In Component2CW embed view (Component1CWInterfaceView) as Embed Interface View of a Component Interface, and set this view as default.
    9) In Component2CV add inbound plug "FromComponent1"
    10) In Component2CW link embedded View Component1CU.Conponent1CWInterfaceView.GoToComp2 with Component2CV.FromComponent1
    11) Build-deploy-run. Click on button. It should work.
    Regards, Maxim R.

  • How to define exit plug for interface view?

    hi experts,
                  I am trying to define exit plug for interface view , but i am not able to make interface view into change mode. it doesnt allow me. what should be done/
    Thanks,
    saurin shah.

    Hi ,
           Check the Interface in the Window this will reflected in the Interface Window
    Regards
    Vikranth

  • Using only 1 view from a component ( usage )

    hi experts..
    I have a component C1 with 7 views...
    I have another componet C2 in ehich i want to use only 1 view of the component C1 rather than the entire component...
    How can i do that...
    jagruti

    Hi again.
    can u make it more simpler sascha..
    In the component controlelr of C1 create en event
    (mark as interface).
    Steps below r not clear.....
    Then in the actíon handler method of C1 fire this
    event.
    The action handler method assigned to the back button in the view you want to use in C2. Here you can use the wizzard to fire the event in the component controller. There should be a fire_... method in the component controller now.
    In the controller of view in C2 which contains the
    ViewUiContainerElement create an event handler method
    for the event of C1. In this handler you fire an
    outbound of the view which navigates to another view
    in C2.
    this is described in the above mention thread. In C2 you created a viuew with the ViewUiContainerElement which embedds the view with the back button of C1.
    Go to the attrib utes tab of this view and add the usage of C1 here.
    Then go to the methods tab of this view and create a method handleBackEvent and choose event handler. In the event columen make a F4 and select the event of the component usage C1. Hit enter.
    Create an outbound plug in this view which should be use to navigate to the view in C2 you want. Then go to the event handler method just created and fire the outbound plug.
    Do not forget to connect the outbound to the inbound of the view you want to navigate to.
    sorry for bugging u..
    No prob.
    jagruti..
    Cheers,
    Sascha
    Message was edited by:
            Sascha Dingeldey

  • Firing the Suspend Plug of Interface View Controller of1 DC from another DC

    Hi Experts,
    Can you please let me know if it is possible to fire a suspend plug from a Component Controller?
    I've been tried it before from View controller on some event and was able to fire the plug successfully but when I am trying to fire the same from the init method of the Component Controller or init method of the view controller, it gives me the below error:
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Instance of interface view controller XXXXCompInterfaceView does not exist.
    I believe that it is not possible to fire the suspend plug from the Init method  of either Component Controller or View Controller.
    So, is it possible to fire the suspend plug in one custom method of a component controller if the custom method is called from some another component?
    Please let me know.
    Thanks & Regards,
    Anurag

    Hi Prashant,
    When I am trying to fire the Suspend plug from my view on click of a button, I am getting the following error:
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Cannot suspend embedded component via outbound plug <Plug Name> of view <Interface View Name>
        at com.sap.tc.webdynpro.progmodel.view.ViewManager.fireSuspendPlug(ViewManager.java:209)
        at com.sap.tc.webdynpro.progmodel.view.View.navigate(View.java:533)
        at com.sap.tc.webdynpro.progmodel.view.View.navigate(View.java:462) 
    Earlier, when I used to fire the plug from my DC; it used to work fine but now my DC is being used as a used DC in another component and since then I am facing this issue.
    Currently, my DC is being used as used DC. I am not sure if I use any used DC, it would work or not.
    Please respond if anybody has any suggestions.
    Regards,
    Anurag

  • Web Dynpro: several navigation links connect to one outbound plug of a view

    Hi,
    I have two questions in general Web Dynpro. (I have not found precise answer for the question yet)
    1) What should happen in the following case?
    We have three views in a component. The outbound plug of the first view is connected to the inbound plug of the second and third view via navigation links. Which view should appear, if i fire the outbound plug of the first view?
    Some documentation says, this case is not allowed, some documentation says it is allowed...
    2) If the previous case is allowed, what should happen in the following case?
    In a child component, a window outbound plug is connected to a view inbound plug. Beside this, I implement an inbound plug of the window, where i fire this outbound plug of the window.
    Now, the interface view is embedded into a parent component window. In the parrent component I connect the outbound plug of the interface component to an inbound plug of a parent view (which is also embedded into the window). I also connect an outbound plug of the parent view to the interface view inbound plug.
    What will happen if I fire the parent view outbound plug? Will the parent view or child view appear?

    Hi Huszar,
    I'm a newbie and found your question interesting. So I played a little with this issue and hope I found something to help you.
    But  I wonder in why you want to use such a constellation the first place. What is your purpose? For me the idea itself doesn't make much sense... Did you by chance actually think of one of the following purposes:
    You want two different action elements (e.g. 2 buttons) to fire different conenctions. Then you should use different outbound plugs. Connect the two buttons and the two links to different methods so that the corrsponding plug and button have the same method.
    You want to decide by value or state which view to show. Then you should use two different outbound plugs as well and decide in the button's event handler mehtod which plug to fire , e.g.: if <condition> then <firePlugA> else <firePlugB>.
    Generally, if you connect two views in a window via link you must chose a method to use or create a button. If you chose a method (event handler) the effect in the Java file is that the  method (onActionButtonX()) will call the corresponding firePlugOut-method.
    Unfortunately in the firePlug-method itself there was no hint about the plug's destination. As I connected the same method for button and two plug targets, Web Dypro for no obvious reason always chose the same target. I did not find a possibility to directly chose the target from one outbound plug, so I guess this information is stored somewhere in the background logic.
    Did I get the point or did you think of something completely different? Or maybe you just asked theoretically? In that case I don't seem to get the idea.
    Kind regards,
    Jana

  • Problem in construct_url and firing outbound plug data passing

    Fnds,
    I have been posting this but no one was able to help me specifically.
    I am calling other WDA2 from WDA1.. i used construct_url, and called the outbound plug which is type suspend.
    so wda2 is opening in same browser. .good.
    but i want to send a value to the URL .. basically i can see parameter in outbound plug as url..
    but how to pass the value to URL..
    and in WDA2, how to read this value... pls plsssssss..
    i know its simple, but i need some sampel code or example which reads this value of URL.
    kindly help me..
    Niraja

    Hi Nirja,
    You must have done this coding to call WDA2.
      DATA lv_url TYPE string.
      CALL METHOD cl_wd_utilities=>construct_wd_url
        EXPORTING
          application_name = 'ZWDA2'
        IMPORTING
          out_absolute_url = lv_url.
      CONCATENATE lv_url '?sap-client=' sy-mandt '&sap-language=' sy-langu '&PARAM1=' <P1> '&PARAM2=X'
      INTO        lv_url.
      wd_this->fire_out_plg( url = lv_url ).
    here out is suspend plug of WDA1.
    now here is the code u need to do the coding in HANDLEDEFAULT method of default window of WDA2 to get the parameter passed by WDA1.
      DATA ls_url TYPE LINE OF tihttpnvp.
      DATA lt_url TYPE tihttpnvp.
      wdevent->get_data(
      EXPORTING
        name = if_wd_application=>all_url_parameters
      IMPORTING
        value = lt_url ).
      LOOP AT lt_url INTO ls_url .
        CASE ls_url-name.
          WHEN 'PARAM1'.
            <your logic to handle value of param1
          WHEN 'PARAM2'.
            <your logic to handle value of param2
          WHEN OTHERS.
        ENDCASE.
      ENDLOOP.
    moreover you need to fire simpel exit plug in WDA2 to get back to WDA1. And obviously you will have to define resume plug in WDA1.
    Hope you will be having enough clarification.
    -Haresh
    Edited by: Khandal Haresh on Nov 7, 2008 5:00 AM

  • How to pass parameters of outbound plug of one view to other view...

    Hello All,
    i have a scenario like this.
    1) i have two views(View1, View2) and iam calling View2 using View1 Outbound plug which is having one parameter(Par1). iam filling this parameter in lead_select method using
    "wd_this->fire_op_to_display_plg (
    par1           =   itab-name1
    In the debugging iam able to see Par1 is filled with value.
    2) In View2 iam calling View1 using Inbound plug with no parameters.
    3) I have to pass this Par1 which i got in View1 to View2 so that i can use this for displaying the output(this parameter is mandatory in processing the data of View2.
    Could any one suggest how can i approach to solve this problem step by step.
    Thanks,
    Sree.

    go to the the method of inbound plug in methods tab of view 2
    and add the same parameter with same name and with the same type and directly access in the method..
    see the picture  test is the inbound plug
    http://flickr.com/photos/28584284@N04/2845020873/
    Abhi

  • How to Access the view from another Component

    Hi,
    Seek your advice on this following requirement.
    1. Would like to add the view OVWindow of Component BTCATEGORIES in an assignment block of 
        CRMCMP_CMG similar to the assignment block exists in the BT116H_SRVO component.
    2. Please provide the step by step procedure to implement this requirement.
    Regards,
    Arif

    Hi,
       I am having view1 and view2.
      in view1 i am using roadmap. S1 is one of the step of road map.
      in view1 i used this code to get the reference of this view in componentcontroller attribute
    Data: lo_api TYPE REF TO if_wd_view_controller.
    If first_time = 'X'.
    lo_api = wd_this->wd_get_api( ).
    wd_Comp_Controller->my_VIEW = lo_api.
    endif.
    in my view2 i want to access the roadmap step
    i dono how to access that.. i used this code.......
             wd_comp_controller->my_view->get_element( 'S1' ).
    is this correct.. If not what is the code to get that id..
    Can any one tell me clearly...

  • Launch PowerPoint in Slide Show View from within SharePoint

    I am trying to create a hyperlink that launches the powerpoint in slideshow mode. 
    For 2010:
    http://site/_layouts/PowerPoint.aspx?PowerPointView=SlideShowView&PresentationId=url
    This solved my issue in SharePoint 2010, but now I am upgrading and this solution does not work.  Is there an alternative?  My error suggests that PowerPoint.aspx does not exist.  
    Thanks,
    Jesse
    Jesse A. Brandenburg

    Hi Jesse,
    You can open a PPT file
    using PowerPoint Web app in the browser and click “START SLIDE SHOW”. Then it will pop up a window for showing the PPT in the slide
    view. You can verify the URL of the popup.
    Also I find the format of the URL:
    http://site/p/PowerPointFrame.aspx?PowerPointView=SlideShowView&ui=en-US&rs=en-US&WOPISrc=url&sc=url
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to consume a method on the interface controller from another component?

    Hello,
    I have a project which contains two Components, A & B.
    I have exposed a method at the interface controller of Component A. How can I consume it from Component B?

    Hi,
       First add ComponentA as a used webdynpro component in ComponentB. Then open the Interface Controller of B and switch to Properties Tab. Select Add in the "Required Controllers" section. From the dialog that appears, select A's interface controller. Then you can access A's method from B's interface controller as:
    wdThis.wdGetAComponentInterface().<method>;
    Regards,
    Satyajit.

  • Creating a table/view or temporary table from within a stored procedure

    Hi Gurus,
    Can someone tell me if it is possible to create a table (or view) from within a stored procedure.
    PROBLEM:
    In fact I need to create a report at back end (without using oracle developer forms or reports). This report requires creating several tables to hold temporary report data. If I create a sql*plus script for this, i works fine, because it can run DDL and other sql or pl/sql statements sequencialy. But this sql*plus script cannot be called from application. So, application needs an stored procedure to do this task and then application call that procedure. But within stored procedure, i am unable to create table (or run any ddl statement). Can somebody help me in this?
    Thanks in Advance.

    Denis,
    The problem with Nicholas' suggestion isrelated to the fact that now you have two components
    (a table and a stored procedure)
    I don't see any problem to have "two
    components" here. After all, what about all others
    tabes ? This is only one more, but I don't understand
    why want manage less objects, that implies more code,
    more maintenance, and more difficulties to debug.
    Needless to say about performance...
    Nicolas.The same reasons apply if you were forced to declare all PL/SQL variables publicly (outside the stored proc.) rather than privately (from inside the stored proc). Naming conflicts for one. If the name that you want to use for the GTT already exists, you need to find a new name. With the SQL Server type local/private declarations, you wouldn't have that problem.
    I can see how performance would be the same or better using GTTs. If the number of records involved is low, this is likely negligable.

  • Not defined outbound plug in Window or View but exists in NavigationLink

    Hi Experts,
    In  NavigationlLink of  standard component 'BSPWD_ADVSEARCH'  contains the outbound plug  'SavedSearchEdit'.
    But I am not able to find where the outbound plug is defined since it is not defined in its window or view.
    Please explain me where the OUTBOUND plug is defined.
    Thanks in Advance

    Hi Raj,
    The Outbound plug is defined for the bsp component - BSPWD_ADVSEARCH.
    You can check the same in SPRO settings by following the path:-
    SPRO->CRM->UI FRAMEWORK->TECHNICAL ROLE DEFINITION -> DEFINE WORKAREA COMPONENT REPOSITORY.
    Here select the BSP component - BSPWD_ADVSEARCH  & select INBOUND PLUG DEFINITION option on the left side.
    You'll see 2 IPs defined along with their Target IDs.
    - Dedeepya

  • Browser Closes when outbound plug is fired

    Hi Experts,
    If I have a Adobe pdf file in my view and I click on a UI Button element which invokes the outbound plug of the view, then all the browsers close. There is no error message.
    If I use UI elements and invoke the outbound plug then the application works fine.
    Can anybody help me solve this problem
    Regards
    Abdullah

    Problem was in ACF

  • How to fire outbound plugs of a window?

    I have a component which I want to re-use in applications. The component should have 2 outbound (interface) plugs which can be wired into parent applications. When the user clicks buttonA in the component it should fire outboundPlugA, likewise for buttonB we have outboundPlugB. My problem is that I can only seem to fire outbound plugs of the view and not of the window.
    Until now, we've solved this by firing interface events of the component controllers but it seems plugs would be more elegant.
    How does one fire outbound plugs of the window?

    OK, I've done what you said and have the following in the event handler (action of a button) in my view:
      DATA:l_ref_test TYPE REF TO ig_comp1_window.
      l_ref_test = wd_this->get_comp1_window_CTR( ).
    The compiler error message is:
    Method "GET_COMP1_WINDOW_CTR" is unknown or PROTECTED or PRIVATE.
    This method does not exist as far as I can see.

Maybe you are looking for

  • My CD drive isn't working anymore

    Hi to all. I've had my Macbook pro for about...4 or 5 years now. I'm trying to copy some music from CD's i recently bought but for some reason my CD-Rom drive just keeps spitting CD's out. I put the CD in, and it spits it right back out without it ev

  • How to customize some rows default selected in tableSelectMany

    Hi all, How to set some rows default selected in tableSelectMany Thanks Jayson

  • Free Trial of Lightroom 5 download difficulty

    I have been unable to download trial version of Lightroom 5 from Adobe site. I have disabled pop up blocker as requested but no joy. Any ideas? (I already have the full version of Lightroom 4 installed on my PC. Operating system is Windows 7).

  • Broadband Connection Keeps Dropping - ERROR_NO_CAR...

    Hi, I've been disconnected frequently (sometimes >10 times in 12 hours) when I look at the HH3 Event Log I can see a ERROR_NO_CARRIER for each break in the connection. This started on 9th December which was same day I got notification from BT that my

  • Trouble Registering Quicktime Pro

    I've done everything it said to do in order to "unlock" Quicktime Pro, but NOTHING works. Help perhaps?