0

I am opening a new window using window.open() like below:

<input type="button" value="open" onclick="window.open('http://www.google.com', 'popupWindow', 'dependent=yes, menubar=no, toolbar=no')" />

But the window is appearing of the left bottom. How can I move this popup Window to center?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Harshita Sethi
  • 2,035
  • 3
  • 24
  • 46
  • 1
    That deprecated `
    ` tag is merely hanging here. It knows nothing about the window being opened. This has nothing to do JSF. You will need to do some calculations in JavaScript to position a newly opened window in the centre of the screen. Type appropriate keywords into the Google search box. You will find results like [this](http://stackoverflow.com/q/4068373/1391249) and [this](http://stackoverflow.com/q/6983552/1391249).
    – Tiny Dec 24 '15 at 10:12
  • 1
    Check this link. It will help you http://stackoverflow.com/questions/4068373/center-a-popup-window-on-screen – MaxPayne999 Dec 24 '15 at 12:52
  • Those links are helpful. But I was expecting a JSF way to achieve it. I am new to JSF so wanted to know if such command is there or not. – Harshita Sethi Dec 24 '15 at 12:56
  • Opening a browser window is not the subject of JSF which generates some HTML / JavaScript / CSS and renders them as a response which is then to be interpreted by the target browser. Browsers are thus completely unaware of the presence of JSF. The answer to this question is already covered by the duplicate link. If you are however, willing to use a rich JSF component library like PrimeFaces, it supports in-built overly components like [``](http://www.primefaces.org/showcase/ui/overlay/lightBox.xhtml) with which you can also get rid of awkward popup blockers. – Tiny Dec 24 '15 at 14:09

0 Answers0