Skip to Content
avatar image
Former Member

how to get the parameter passed through outbound plug in the other view

Hi

I am trying to pass a parameter through outbound plug to the the other view that has this inbound plug to it.so i just now wanted to know the process of how to get this passed parameter in the other view.

i guess in the wdinit we need to do something but not able to find out how and what to do.

so any help in this willl b highly appreciated.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 04, 2008 at 08:59 AM

    Hi,

    Have you tried this

    WDProtocolAdapter.getProtocolAdapter().getRequestObject().getParameter(key)

    Regards

    Ayyapparaj

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 04, 2008 at 09:21 AM

    Hi Sudeer,

    to get the parameter no need to code at the doinit. When you are declaring parameter for out bond plug, declare the same for inbound.

    And when outbond plug is going to fired it'll navigate to the 2nd view and inbound plug action will take place, here you can get the parameter value.

    Like i have used in one of my application.e.g.;-

    Outbondplug

    wdThis.wdFirePlugOnEdit(wdContext.nodeClassifiedsElements().getClassifiedsElementsElementAt(count) .getClassifiedsResources(),filestatus);

    in that i m passing Resource and String as a parameter. and i m getting this two value in the corresponding in-plug:-

    *public void onPlugfromListview_onEdit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sapportals.wcm.repository.IResource title, java.lang.String status )*

    {

    //code

    here you can use title and status coming frm the other view.

    }

    Hope that'll help you.

    Regards,

    Deepak

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 04, 2008 at 10:19 AM

    Hi,

    Suppose i have two views firstview and secondview.

    1)Create an outbound pulg(say tosecond) in Firstview say with a parameter of type String .

    2)create an inbound plug(say fromfirst) in secondview with a parameter of type string

    fire ur tosecond plug from firstview.

    wdThis.wdFirePlugTosecond(wdContext.currentContextElement().getCtx_name());
    
    

    Now go to secondview u fill a corresponding event handler in

    for ur inbound plug with a parameter.

    In that event handler u can set any context varibale with that parameter.

    public void onPlugfromfirst(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String hello )
      {
        //@@begin onPlugfromfirst(ServerEvent)
        wdContext.currentContextElement().setCtx_String(hello);
        //@@end
      }
    

    No need to write anything in init().

    regards

    Surender Dahiya

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Sudeer,

      Assume you have two Web Dynpro components. Each has one view: view1 and view2. You should define inbound plug in the appropriate Interface View of the second component. Interface View is created automatically for each Window you add to the component. So here are the main steps:

      <OL>

      <li>Create a new window in your second WD component (or use existing one)</li>

      <li>Embed view2 to the window from step 1</li>

      <li>Open appropriate Interface View for the window from step 1: goto Component Interface->Interface Views-><WindowName>InterfaceView </li>

      <li>Create Inbound Plug on the Plugs tab and define necessary parameters for it (it's the same thing as define inbound plug for a view)</li>

      <li>Add the second WD component to the Used Web Dynpro Components of the first WD component</li>

      <li>Open existing Window (or create new) of the first WD component where the view1 with outbound plug is embedded</li>

      <li>Embed Interface View or a Component Instance <WindowName>InterfaceView of the second WD component to the window from previous step</li>

      <li>Connect outbound plug of the view1 to inbound plug of <WindowName>InterfaceView</li>

      </OL>

      Remember that parameter names and parameters order should be the same for inbound and outbound plugs.

      Regards

      Ivan

  • avatar image
    Former Member
    Jun 04, 2008 at 10:24 AM

    Hi Sudder,

    A work around for this can be to create a context in the component controller ( or the custom controller, if you have used any ) of the data-type that you want for the parameters to be passed.

    Then map these parameters from the controller to both the views.

    Set these parameters in the parent view and access them from the child view.

    In this case, you will not require to pass parameters with the plug.

    Hope that'll help you.

    Regards.

    Edited by: Sudeep Sura on Jun 4, 2008 3:55 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 04, 2008 at 10:25 AM

    Tnx guys

    this works for views in the same component but i want to achieve this same within two different compnets

    meaning one view in one componet to other view in another component

    Add comment
    10|10000 characters needed characters exceeded