on 07-26-2007 10:40 AM
Hi,
May I know how to create a pop up window in java webdynpro once click on the button ?
Thank you very much.
Create a new window and embed the popup view
create a windows instance
to start the popup:
IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("PopUP");
IWDWindow window = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);
window.setWindowPosition(300, 150);
window.open();
wdContext.currentExternalWindowElement().setWindowInstance(window);
to close the popup
IWDWindow window=(IWDWindow)wdContext.currentExternalWindowElement().getWindowInstance();
window.destroy();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eric,
For achiving popup window in web dynpro you have to use IWDConfirmationDialog API's.
You have to use following code inside your button Action method :
-
<b>IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
String dialogText = "Some text whatever you want to display on popup";
IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow( dialogText, controllerInfo.findInEventHandlers("AcceptYES"),"Yes");
dialog.addChoice( controllerInfo.findInEventHandlers("AcceptNO"), " No ");
dialog.open();</b>
-
On the above code I have used Event Handler for 'Yes' and 'No' button which will appear in popup window. That Event handler will invoke regarding the clicking on 'Yes' or 'No'. You can create eventhandler with the help of Method tab of your view. So that it will generate associated method in the implementation tab, there u can write your business logic.
************hope this will help you******************
thanks & regard,
Pankaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
For Popup
1) Create a value attribute of type com.sap.tc.webdynpro.services.session.api.IWDWindow in the main window.
2) Create a value attribute of the same type above in the popup view.
3) Do a context mapping for the attributes.
4) Type the code given below in the event handler from where you want the window to popup.
Code for opening a popup
IWDWindowInfo wininfo = wdComponentAPI.getComponentInfo() .findInWindows(<Popup window name>);
IWDWindow win = wdComponentAPI.getWindowManager().createWindow(wininfo,true);
win.open();
wdContext.currentContextElement().set<value attribute name>(win);
Code for destroying the popup
Type the code given below in the event handler in the popup window from where you want to close the window.
IWDWindow win = wdContext.currentContextElement().get<value attribute name>;
win.destroy();
For opening a external url
IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(
"http://www.google.com","value",false);
window.open();
In NW 2004s open method is deprecated for this you use show instead of open
Refer this thread for this
Hope this helps,
Regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This tutorial shows how to create pop-up:
Regards,
Ashwani Kr Sharma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.