on 07-07-2009 1:39 PM
hai,
I wanna to create a web dynpro application which have a button. When a click a button an application open a popup window of an another view(with the frame) as such as the popup window in portals.
how can i do this..Please help on this issue.
thank in advance
Krish.
Hi,
Create two Views and two Windows and one Application.
View1>Window1>App1
View2->Window2
Now when user clicks on "OpenWindow2Popup" button in View1 in Window1 open the Window 2 as popup Window:
IWDWindowInfo winInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("Window2");
IWDWindow popup= (IWDWindow)wdComponentAPI.getWindowManager().createModalWindow(winInfo);
wdContext.currentContextElement().setWindow2Inst(popup);
popup.setTitle("Window2");
popup.setWindowSize(220,150);
popup.setWindowPosition(100,100);
popup.show();
Note: Create one context attribute Window2Inst of type IWDWindow and map this attrinbute to both the View1 & View2 throgh the component controller. In View2 when user clicks on Close button execute the below line of code to close the popup.
wdContext.currentContextElement().getWindow2Inst().destroyInstance();
Regards,
Charan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Refer this code,
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("PopWin");
IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
window.setWindowPosition (300, 150);
window.show();
wdContext.currentPopupNodeElement().setPopupAttribute(window);
Regards,
Sunaina Reddy T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Go through the above PDF
Hope this helps you..
Regards,
Saleem
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hai Charan,Jaya and saleem,
Thanks to all,
I refered ur refernces and tried it. Its working well..
Sorry i have queried u worngly it seems.
Please check this code...
IWDWindow win =wdComponentAPI.getWindowManager().createExternalWindow("http://www.google.com","SHOW EXTERNAL WINDOW",false);
win.setWindowPosition(100,100);
win.removeWindowFeature(WDWindowFeature.ADDRESS_BAR);
win.removeWindowFeature(WDWindowFeature.MENU_BAR);
win.removeWindowFeature(WDWindowFeature.STATUS_BAR);
win.removeWindowFeature(WDWindowFeature.TOOL_BAR);
win.open();
Using the above code we can create an external window...
in the place of
createExternalWindow(<view / window>,"SHOW EXTERNAL WINDOW",false);
i want to use window refernce / info instead of using url... Is this possible..
Or else how can i do this...
Regards ,
Krish.
Hi Krish,
The only way to call a window or a view as a pop up is exactly what has been given by others. If you want to open a view of a webdynpro applocation then you have to always embedd that view in window and have to use the findWindow() API to get the reference of the window and then open it as the popup.
This is the only way.
However, if you are saying that you have a "iView" of portal already in place, and you want to show that as the popup then you can use the way you are using. I mean the createExternalWindow API. This will accept the URL as the parameter.
You can pass the URL iView path in this or the path of the application as the parameter to this createExternalWindow API.
I hope this helps. Please revert back in case you need any further information on this.
Thanks and Regards
Pravesh
Hi,
If you want the url of the another window in your WD Component. As per my knowledge you need to have a seperate application to be created for this window also.
For Example you have Window1 (View1 is embeded in this window) and Window2(View2 is embeded in this window). Now you need the url of the Window2.
So for this purpose you need to create two applications for this WD Component.
For example as below:
App1 - Created for Window1InterfaceView - Window1 - View1
App2 - Created for Window2InterfaceView - Window2 - View2
Now use this below code to open the Window2 URL in a sepearate window.
// Get name of deployable object this component belongs to
String deployableObjectName =
wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
Map urlParameters = new HashMap();
// If there are any application parameters you need to pass to App2 you can set those in urlParameters
// as urlParameters.put("key","value");
try {
// Get deployable object part of target application.
// Precondition: assume, that other application belongs to the same
// Web Dynpro Project (Deployable Object)
WDDeployableObjectPart deployableObjectPart =WDDeployableObject.getDeployableObjectPart(
deployableObjectName,"App2",WDDeployableObjectPartType.APPLICATION);
// Get target URL based on deployable object part and URL parameters
String urlToTargetApp =WDURLGenerator.getApplicationURL(deployableObjectPart, urlParameters);
//Open this urlToTargetApp in external window.
IWDWindow window = wdComponentAPI.getWindowManager(.createNonModalExternalWindow(urlToTargetApp,"Window2");
window.show();
} catch (WDURLException e) {
messageMgr.reportException(e.getLocalizedMessage(), false);
} catch (WDDeploymentException ex) {
messageMgr.reportException(ex.getLocalizedMessage(), false);
}
Note: We are opening another window using another WebDynpro application.
Here it creates a seperate WDComponent instacne. You can't access Window1(View1)'s existing context data in Window2(View2). The only way is you can pass some data using app/url parameters.
Apart from this as per my knowledge there is no other way to get the url for a Window.
Check this thread:
Regards,
Charan
Hi Krish,
Create one window named popupwindow. And embed the view which you want to open it as a popup.
Make the default value property of that view as true.
Now write the following code.
IWDWindowInfo winInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("popupwindow");
IWDWindow popup= (IWDWindow)wdComponentAPI.getWindowManager().createModalWindow(winInfo);
wdContext.currentContextElement().setWindow2Inst(repUnitWindow);
popup.setTitle("Title");
popup.setWindowSize(220,150); // change the size to fit your view
popup.setWindowPosition(100,100); // change the position to make it center or to fit your requirement.
popup.show();
Regards,
Jaya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.