on 09-05-2008 8:03 AM
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 ?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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 !
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.
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
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.