Centre a popup window

Hi,
I’m trying to put in the centre of the screen a popup window using the following code:
IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.
     getComponentInfo().findInWindows("Test");
IWDWindow window =wdComponentAPI. getWindowManager().
createWindow (windowInfo, true);     
Dimension auxDimension = java.awt.Toolkit.
getDefaultToolkit(). getScreenSize();
int initialH = new Double(auxDimension.getWidth()).intValue();
int initialW = new Double (auxDimension.getHeight()).intValue();       
window.setWindowPosition((initialH-200)/2,(initialW-50)/2);
but the code line
Dimension auxDimension = java.awt.Toolkit.
getDefaultToolkit(). getScreenSize();
throws an  java.awt.HeadlessException exception
Then, How can I put in the centre of the screen a popup window?
Thanks,
Ricard.

Hi,
     Use  the following code:
    window.setWindowPosition(WDWindowPos.CENTER);
Kind Regards,
S.Saravanan.

Similar Messages

  • How to get the values from popup window to mainwindow

    HI all,
       I want to get the details from popup window.
          i have three input fields and one search button in my main window. when i click search button it should display popup window.whenever i click on selected row of the popup window table ,values should be visible in my main window input fields.(normal tables)
       now i am able to display popup window with values.How to get the values from popup window now.
       I can anybody explain me clearly.
    Thanks&Regards
    kranthi

    Hi Kranthi,
    Every webdynpro component has a global controller called the component controller which is visible to all other controllers within the component.So whenever you want to share some data in between 2 different views you can just make it a point to use the component controller's context for the same. For your requirement (within your popups view context) you will have have to copy the component controllers context to your view. You then will have to (programmatically) fill this context with your desired data in this popup view. You can then be able to read this context from whichever view you want. I hope that this would have made it clear for you. Am also giving you an [example|http://****************/Tutorials/WebDynproABAP/Modalbox/page1.htm] which you can go through which would give you a perfect understanding of all this. In this example the user has an input field in the main view. The user enters a customer number & presses on a pushbutton. The corresponding sales orders are then displayed in a popup window for the user. The user can then select any sales order & press on a button in the popup. These values would then get copied to the table in the main view.
    Regards,
    Uday

  • In a multiple monitor situation, how do I get popup windows to open on the same monitor as the parent application is displayed.

    I have two monitors. I have an application that I run all day, displayed on my secondary monitor. Whenever a popup windows is launched form that application, it always opens on the primary monitor. Very annoying. Any way to get the popup to launch in on the same monitor as the parent application?

    Did you solve this problem ?

  • Even though block popup windows is unchecked in content tab of options, I am still not getting any popups. Please help me.

    Hi - Even though block popup windows is unchecked in content tab of options, I am still not getting any popups. Please suggest how to over come this problem.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    Did you make sure that your security software isn't blocking the pop-ups?
    Boot the computer in Windows Safe Mode with network support (press F8 on the boot screen) as a test.
    *http://www.bleepingcomputer.com/tutorials/how-to-start-windows-in-safe-mode/

  • SSO UIDPW not working for external Popup Window but works with SAPLOGONTICK

    Dear Experts,
    I have an issue with SSO user mapping (UIDPW), but the same scenario is working with SAPLOGONTICKET.
    Some list gets displayed in the Web Dynpro ABAP iView which has the hyperlinks where on click on the hyper link it opens a external popup window (another Web Dynpro Application) and display the summary some data.
    This scenario works when I set the logon method to SAPLOGONTICKET, but when I set it as UIDPW it won't work when a new window opens on click on the hyperlink from Web Dynpro iView as stated above. It asks to login to R/3 system.
    Can anyone please let me know what could be the reason it fails in External Popup window scenario when logon method as UIDPW.
    Thanks
    Murthy

    Hi Murthy,
    You can use application integrator iView to integrate your ABAP application into the portal and you'll be able to pass the variables <MappedUser>, <MappedPassword>, etc. assuming you know about the security risks in passing mapped info.
    http://help.sap.com/erp2005_ehp_05/helpdata/en/36/5e3842134bad04e10000000a1550b0/frameset.htm
    Still, your ABAPers might need to handle the passed in variables in the first ABAP application and pass them onto the second one.  Again, without knowing how you navigate between the 2 apps and other details about your system landscape, versions, etc. this remains as a guess.  If you search SDN, you'll find many different solutions then you can choose one which is most suitable for your situation.
    Regards,
    Dao

  • How to close main window on click of a button on popup window

    Hi All,
    I have created a web page which on certain condition display a popup window to to provide information. Wht i want is that when i click on close button on my popup window, my main window should also close.
    Can anyone please help with this requierment!!!
    Regards,
    tushar

    Hi All,
    Could anyone of you please help me by answering the thread
    WDDOEXIT method not called when the application is closed from the portal
    Thanks,
    Subash M

  • How to disable parent window while popup window is coming

    Hi,
    I am working on Oracle Applications 11i.
    I am able to get the popup window using the Java script in the controller.
    Please see the below code for the reference.
    String pubOrderId = pageContext.getParameter("orderId");
    StringBuffer l_buffer = new StringBuffer();
    StringBuffer l_buffer1 = new StringBuffer();
    l_buffer.append("javascript:mywin = openWindow(top, '");
    l_buffer1.append("/jct/oracle/apps/xxpwc/entry/webui/AddAttachmentPG");
    l_buffer1.append("&retainAM=Y");
    l_buffer1.append("&pubOrderId="+pubOrderId);
    String url = "/OA_HTML/OA.jsp?page="+l_buffer1.toString();
    OAUrl popupUrl = new OAUrl(url, OAWebBeanConstants.ADD_BREAD_CRUMB_SAVE );
    String strUrl = popupUrl.createURL(pageContext);
    l_buffer.append(strUrl.toString());
    l_buffer.append("', 'lovWindow', {width:750, height:550},false,'dialog',null);");
    pageContext.putJavaScriptFunction("SomeName",l_buffer.toString());
    But here the problem is, even though popup window is there, i am able to do the actions on the parent page.
    So how to disable the parent page, while getting the popup window.
    Thanks in advance.
    Thanks
    Naga

    Hi,
    You can use javaScript for disabling parent window as well.
    Refer below link for the same:
    http://www.codeproject.com/Questions/393481/Parent-window-not-disabling-when-pop-up-appears-vi
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • RE: Getting multiple values from more than one multiple select popup window

    I have a button on a JSP of mine that when clicked creates a popup window (right now it is called popup.html) with a multiple select menu.
    My question is how do I get all the values selected from the menu into my JSP (sample.jsp) so that I can set each of the values for my bean.
    The other problem is that I have more than one select multiple menu.
    Please help if you can. Any advice or suggestions here would be greatly appreciated!
    Thank you!

    I realize that I can use request.getParameterValues to get the values selected from my html because I am passing them to the hidden inputs I have and then using the request.getParameterValues to get each of the values.
    MY PROBLEM IS WHAT IF I HAVE 4 MULTIPLE SELECTS??? How can I use the same html popup menu to get the values from the 4 different multiple selects????
    I look forward to your response.
    This code is from my JSP:
    <INPUT TYPE="TEXT" NAME="Field1" SIZE="15">
    <INPUT TYPE="hidden" name="F1Rad1">
    <INPUT TYPE="hidden" name="Permission">
    <input type=button name=choice onClick="window.open('optionPicker.html','popuppage','width=250,height=100');" value="Options"></TD>
    Here is my optionPicker.html code for the pop up menu:
    <html>
    <head>
    <script language="JavaScript">
    function sendValue(s)
    var boxSize= s.options[0].value;
    var restrict     = s.options[1].value;
    window.opener.document.addNewForm.F1Rad1.value = boxSize;
    window.opener.document.addNewForm.Permission.value = restrict;
    window.close();
    </script>
    </head>
    <body>
    <center>
    <form name=selectform>
    <select multiple name=selectmenu size="2">
    <option value="large">Large Text Input Area
    <option value="restrict">Restricted Access
    </select>
    <p></p>
    <input type=button value="Select Option(s) For Field" onClick="sendValue(this.form.selectmenu);">
    </form>
    </center>
    </body>
    </html>

  • How to pass the values from popup window to parent's window

    Hi Experts,
    in my application i need to develop one popup window in that i have created 4 dropdowns and one ok button , if i willl click on that ok  button the values should pass to parent window dropdownlistboxes
    can any body suggest how i will get the popup window values
    thanks in advance,
    ramani.

    Hi Ramani,
    I can provide few inputs on how can we control JSP 2 from JSP1.
    Here is the code. Check if you can convert this to make useful to you. I am not passing values but control.
    here it is:
    JSP 1.
    <h1>Page One</h1>
    <br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>.html#part1">part 1</a>
    <br><br><br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>#part2">part 2</a>
    <br><br><br>
    <a href="/irj/portalapps/<PAR_FILE_NAME>/images/<HTML_PAGE_NAME>#part3">part 3</a>
    JSP 2.
    <h1>Page Two</h1>
    <br>
    <a name="part1">
    <h3>Part 1</h3>
    </a>
    <a name="part2">
    <h3>Part 2</h3>
    </a>
    <a name="part3">
    <h3>Part 3</h3>
    </a>
    This way you can move from one JSP to other.
    regards
    -Kedar Kulkarni
    reward points if useful.
    Message was edited by:
            Kedar Kulkarni

  • I need the code for creating popup windows and code for open and close

    I can write the code for creating popup window , i am getting problem while trying to open and closing that popup windows.
    Can anybody help me in that pls ?
    Regards
    Sreeni.

    Hi
    For pop up window
    IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows("PopWin");
    IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
    window.setWindowPosition (300, 150);
    window.show();
    wdContext.currentYourNodeElement().setPopupAttribute(window);
    For closing window code
    IWDWindow window = wdContext.currentYourNodeElement().getPopupAttribute();
    window.hide();
    window.destroyInstance();
    For more infornation refer this link
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/20d2def3-f0ec-2a10-6b80-877a71eccb68&overridelayout=true
    This link is very useful for you.
    Regards
    Ruturaj
    Edited by: Ruturaj Inamdar on Aug 13, 2009 9:10 AM

  • Save and close popup window

    I have a typical popup window launched using the builtin javascript:popupURL().
    I would like a Save and Close button on this popup window that does
    1. Submits the popup page so that changes are saved into session state
    2. Close the popup window
    3. Refresh the parent window so that updates in (1) are reflected
    What is the recommended way of doing this? I was thinking of the following URL redirect on the Save & Close button
    doSubmit('SAVE');
    window.opener.location.reload();
    window.close();Do I need a same-page branch on the popup page? If so, why? If not, why? ;-)
    Comments?
    Thanks

    This is a bit of javascript that I nicked which works well for me:
    -- 1. Add the folowing to your page header or create a new page template --
    -- (popup window template) and put it in the header section. --
    SCRIPT LANGUAGE="JavaScript">
    function loadinparent(url, closeSelf){
         self.opener.location = url;
         if(closeSelf) self.close();
    </SCRIPT>
    -- 2. Use the following to call the function. the true and false keeps the parent--
    -- window open or closed. Obviously set any values in the URL. --
    javascript:loadinparent(''<URL>'', true)
    eg. javascript:loadinparent(''f?p=&APP_ID.:40:&SESSION.::NO::P40_ID:'||ID||''', true)
    -- Inc the following comment in your header --
    -- Version 1.0
    -- Last Updated: May 18, 2000
    -- Code maintained at:
    -- http://www.moock.org/webdesign/javascript/
    -- Copy permission granted any use provided this notice is unaltered.
    -- Written by Colin Moock.
    Simon

  • Custom pushbutton in ME21N should display a popup window with item details

    Hello,,
    The requirement is to
    1. Add a custom pushbutton in ME21N screen at header level.
    2. The user will select some PO line items and will click on this push button.
        This inturn should trigger a popup window with item details only for those selected PO line items along with schedule line qty.
    I have created the custom push button in a custom tab using the BADI ME_GUI_PO_CUST.
    Now I am not able to retrieve item details and schedule line details inside the PAI of the custom tab..
    i.e., when i click on the custom push button, I am not able to retrive the item data and schedule line data.
    Please help me to retrive PO line item data and schedule line data.
    Regards,
    Sharah

    JSF is not so relevant in this question. It's all about how the generated client side code look like. Which is usually a bunch of HTML/CSS/JS (open page in browser, rightclick and view source). If you know HTML, you should know that using target="_blank" in a <form> or <a> element would open a new window. If you know JS, you should know that using window.open() would open a new window.
    Apply this so in the JSF source code so that the generated HTML/JS output is exactly what you want.

  • IR truncating leading zeros in my popup window report

    Hello,
    I am using IR_columnname, for one of the columns in my report which is a popup window report.
    My problem is that IR_column search filter in my popup window is truncating the leading zeros.
    I am getting the value but it is truncating the leading zeros.
    like say if the deptno is something like 020 or 0020 in the parent window.
    the IR_columnname value is taking '20' (its truncating leading zeros) with this filter its not dispalying the result in my popup window.
    can anyone help me out with this.
    thanks.

    How are you passing values to the IR filter? There could be a possibility that you source logic is truncating the leading zeros.
    Thanks,
    Manish

  • Creating a PDF report within a popup window

    bq. Hi, \\ Within my application i've a page which uses JasperReports to generate a simple PDF report within prerender(): \\ public void prerender() { \\ try { \\ this.planned_bar_tripsDataProvider1.refresh(); \\ if (this.planned_bar_tripsDataProvider1.cursorFirst()) { \\ getApplicationBean1().*jasperReport* \\ ("PlannedBarTripsReport", "application/pdf", \\ getSessionBean1().getPlanned_bar_tripsRowSet1(), null); \\ } \\ } catch (Exception ex) { \\ log("Exception generating report", ex);} \\ } \\ jasperReport() is taken from the Sun PDF tutorial (http://developers.sun.com/jscreator/learning/tutorials/2/reports.html) \\ Now, when this page is opened within the application (browser) window the PDF report successfully renders. \\ However, when the page is opened within a popup window, using the (onclick) Javascript function: \\ function generateReport() { \\ window.open('PlannedBarTripsReport.jsp') ; \\ window.event.returnValue = false; \\ } \\ the PDF report fails to render. The result is a brief pause followed by a blank popup. No exception. No Abobe embedded window. No clues as to what's gone wrong. \\ Any advice would be greatly appreciated. \\ Ta.

    Hi Venkatv and everyone.
    This is the link where I found about Including Dynamic Images in a Report.
    http://www.oracle.com/technetwork/testcontent/apexprnt2-otn-098981.html
    It's so easy and clear to do.
    Good Luck!!!
    Regards.
    Ayrem

  • I installed Lion 10.7.4.  Went to use Photoshop Cs and got a popup window.  You can't open the application Adobe Photoshop CS because PowerPC applications are no longer supported.    Is there a way of getting this to work or do I have to get the all new!

    I installed Lion 10.7.4.     Went to use Photoshop Cs and got a popup window.  You can't open the application Adobe Photoshop CS because PowerPC applications are no longer supported.    Is there a way of getting this to work or do I have to get newest version of all of my Power PC apps?

    Welcome to Apple Communities
    PowerPC applications are unsupported in newer versions. You can upgrade Photoshop or you can install Snow Leopard in a partition.
    1. Open Disk Utility (Applications > Utilities) and select your drive
    2. Go to Partitions tab, press + button, create a new partition and press Apply
    3. Insert the Snow Leopard install DVD and reboot pressing C key
    4. Install it in the new partition
    5. If you want to change boot, go to System Preferences > Startup Disk and select 10.7

Maybe you are looking for