cancel
Showing results for 
Search instead for 
Did you mean: 

How to link Inbound plug between 2 windows

Former Member
0 Kudos

Dear All,

I create a linktoaction link,

and I want come out when I click this link then windows.open a new view in other windows,

by the way have some data transfer between 2 views,

if 2 viewes in one windows is easy ,but my task is in 2 different windows !!

I don't know how to use Inbound plug or Outbound plug ?

can you help me ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Doke,

I dont think it is possible to create an inbound or outbound plug if you are having two separate windows and views embed in it.

when u click on link to action link in first view u can call the next window as a popup window.

IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("Window Name");

window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);

window.setWindowSize(450, 280);

window.setWindowPosition(50, 75);

window.setTitle("Title Name");

window.show();

regarding data transfer between two views u can share the data by defining the node or context attributes through component controller and doing a context mapping from component controller and views.

Hope this helps u

Regards,

Saleem

Former Member
0 Kudos

Thank Saleem & Ayyapparaj

First not said data Transfer ,

I test the code you give me ,and feel the Popup window only in the right Frame, also can't drag,

the picture :

http://www.anydesign.cn/UpFile/UpAttachment/2008-9/200895162918.gif

can I change to this ?

http://www.anydesign.cn/UpFile/UpAttachment/2008-9/200895163026.gif

Former Member
0 Kudos

Hi,

model Windows cannot be dragged that is how its designed.

To have a window in seperate window you have to use createNonModelExternalWindow method.

Regards

Ayyapparaj

Former Member
0 Kudos

hi! Ayyapparaj

if use createNonModelExternalWindow method can open a IE page,

how to use this method ?

Is very hard ?

Former Member
0 Kudos

Hi,

if use createNonModelExternalWindow method can open a IE page,

Yes.

how to use this method ?

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(URL, title)

URL is the url of the application to be launched.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

u can open an Non model external window in an IE

u have to just write this code

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow("URL");

window.setWindowSize(250,5);

window.show();

Regards,

saleem

Former Member
0 Kudos

Dear Ayyapparaj

how to get Url ,

Is Url = " com.sap.tc.webdynpro.progmodel.api.IWDWindowManager" ?

you can see my code

	IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("Win_Popup");

	IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow("com.sap.tc.webdynpro.progmodel.api.IWDWindowManager" ,"title");

	wdContext.currentContextElement().setWindowRef(window);
	window.setWindowSize(300, 300);
	window.setWindowPosition(50, 50);
	window.setTitle("Title Name");
	window.open();

If use these code ,when I run program,and click the linktoaction link , appear this page :

http://www.anydesign.cn/UpFile/UpAttachment/2008-9/200895181359.gif

can you talk me the Error reason ?

Thank you a lot !

vmadhuvarshi_
Contributor
0 Kudos

Doke,

In a Web Dynpro project, only applications can be addressed by a URL. So, trying to get a URL for your new Window may not be possible. There are 2 ways to get past this issue though.

1. Use the approach suggested by Satyajit in [this Blog|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/7143].

or go this way. I tested this and it works.

2(a). In your popup window, 'Win_Popup' embed an 'Interface View' say"Popup_InterfaceView".

2(b). Assign a plug of type 'Startup' to this Interface View and to embedding Window too if you are using CE 7.1.

2(b). Create a new Application say "Popup_App"and assign your newly created Interface View "Popup_InterfaceView" as its target.

2(c). Get URL for this new application like this.


             String deployableObjectName = wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
               try {
                        WDDeployableObjectPart deployableObjectPart = WDDeployableObject.getDeployableObjectPart(
                        deployableObjectName,"Popup_App",WDDeployableObjectPartType.APPLICATION);
                        String urlToTargetApp = WDURLGenerator.getApplicationURL(deployableObjectPart);
                    }
               catch (WDURLException e) 
                    {
                      messageMgr.reportException(e.getLocalizedMessage(), false);
                    }
       

2(d) Use the generated URL for navigation.


 IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(urlToTargetApp ,"title");
wdContext.currentContextElement().setWindowRef(window);
	window.setWindowSize(300, 300);
	window.setWindowPosition(50, 50);
	window.setTitle("Title Name");
	window.open();

This works.

Hope this helps.

Vishwas.

Former Member
0 Kudos

Since your application runs inside Portal, it is advisable to use [WDPortalNavigation|http://help.sap.com/javadocs/NW04/current/wd/com/sap/tc/webdynpro/clientserver/navigation/api/WDPortalNavigation.html] API. Check this [link|http://help.sap.com/saphelp_erp2004/helpdata/en/b5/424f9c88970f48ba918ad68af9a656/content.htm] and use the WDPortalNavigationMode.SHOW_EXTERNAL_PORTAL or SHOW_EXTERNAL as per the requirement.

Bala

Former Member
0 Kudos

Dear Vishwas.

thanks for your reply,

can you talk to me which part or view I should put the 2(c) code in ?

If you have time ,you can send your test project to my e-mail

" happydiet@126.com"

Thank you very much!

vmadhuvarshi_
Contributor
0 Kudos

Doke,

You need to write this code in the action handler of your starting view. Here is the code that I used in my Action Handler.



public void onActionGo(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionGo(ServerEvent)
         //Declare and initialize the String for URL
	  String urlToTargetApp ="www.google.com";
	  String deployableObjectName = wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
      try {
               WDDeployableObjectPart deployableObjectPart = WDDeployableObject.getDeployableObjectPart(
               deployableObjectName,"TestApp",WDDeployableObjectPartType.APPLICATION);
               urlToTargetApp = WDURLGenerator.getApplicationURL(deployableObjectPart);
           }
      catch (Exception e){}
      IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(urlToTargetApp,"title");
       	window.setWindowSize(300, 300);
      	window.setWindowPosition(50, 50);
      	window.setTitle("Title Name");
      	window.open();
   //@@end
  }


It worked perfectly.

Hope this helps. If this works for you, please close the thread.

Vishwas.

Former Member
0 Kudos

Thanks of all ,I have Solved this problem !

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Following are the steps you need to follow.

Create your context attributes in the component controller

Map this to respective views (even they are in different windows)

Bind this to UI elements.

Now when the link to action is clicked

Call the window which contains your view using the following code



IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("<Your Window Name>");
	  IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
window.show(); 
	  // Store this window for later use to close it

//Code to close the window
//	  window.destroyInstance();

Regards

Ayyapparaj