cancel
Showing results for 
Search instead for 
Did you mean: 

Altering default plugs in applications

Former Member
0 Kudos

Hi,

I have a single WD Project, containing one component, a single window and several viewsets within that window. I want to define 3 different applications where each application fires a different start-up plug to so that it brings up only a specific viewset and causes that one to display in the window. Could anyone please tell me how I can go about this?

Thanks in advance.

MKM.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Stefan,

I am trying to figure a way to do this by altering the default plugs that each view has. The viewsets are interlinked to others and the whole window is quite complicated, so I cant really shuffle them around. Besides, when I open the context menu for the window there is no option to cut/paste the windows. Still looking for an alternative.

Thanks.

MKM

Former Member
0 Kudos

Hi MKM,

first of all i have to say sorry, of course you are right, there is no copy/paste option for Window definitions in the corresponding context menu.

According your problem:

I'm not quite sure, what you mean with "altering the default plugs that each view has". You have to distinguish between the Inbound/Outbound plugs of an InterfaceView (IFV), which corresponds to exactly one Window definition and the I/O plugs of a View. IFVs are created with a "Default" Startup inbound plug, Views don't have something like a default plug.

Since your UI resides in a single window, there's only a single IFV with one default inbound plug.

If i got you right, you want to change the initial navigation inside your single window depending on the WD application started. One possible solution to do this is:

1. Add some Startup Inbound plugs, for example "Edit" and "Display" to your IFV. These plugs are used as startup plugs by the WD applications "EditApp" and "DisplayApp".

2. Add an event "AppMode" with a String parameter "appMode" to the Component Controller (CC). Add a declared method "fireAppModeEvent(String appMode)" to the CC:

public void fireAppModeEvent( java.lang.String appMode )
{
  //@@begin fireAppModeEvent()
  wdThis.wdFireEventAppMode(appMode);
  //@@end
}

3. Add the Component Controller (CC) to the required controllers of your IFV. In the "Implementation" of the IFV you'll get onPlugEdit() and onPlugDisplay() methods. Here you fire the event with the correct application mode:

wdThis.wdGetCCController().fireAppModeEvent("E");
and
wdThis.wdGetCCController().fireAppModeEvent("D");

4. You need a View as part of your view assembly, which is visible as default (DV). DV has 2 outbound plugs "ToViewForEdit" and "ToViewForDisplay". DV subscribes to the appMode event of CC and fires the plugs:

public void handleAppMode(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String appMode )
{
  if (appMode.equals("E")) {
    wdThis.wdFirePlugToViewForEdit();
  } else if (appMode.equals("D")) {
    wdThis.wdFirePlugToViewForDisplay();
  }
}

5. What's missing here are the links between DV's outbound plugs "ToViewForEdit"/"ToViewForDisplay" and the corresponding inbound plugs of the view(s) you want to navigate to. This depends on your UI.

Hope that helps.

Regards

Stefan

Former Member
0 Kudos

Hi MKM,

you should define 3 different Windows, each containing one of the 3 different ViewSets available. Then it's easy to create 3 applications, where the Interface View points to one of the 3 windows defined.

You can copy and paste the current window two times and delete the not necessary parts in each window.

Regards

Stefan