The 'screen', 'window.open()', 'myWindow.document' and 'document.write()' 
will have to be done in JSNI. For the screen, maybe you need $wnd.screen 
(seems unlikely though). Easiest would be to do them all in one method:

public native Document openWin() /*-{
   var 
myWindow=window.open('','','width='+screen.width+',height='+screen.height+',left='+screen.width);
   myWindow.document.write("<p>This is 'myWindow'</p>");
   myWindow.document.write("<span id='span'></span>");
   myWindow.document.close();

   return myWindow.document;
}-*/;

And then:

   Document doc = openWin();
   doc.getElementById("span").setInnerText("something");

I believe your issue with left=screen.width is due to Firefox; does it work 
in pure JS?

Also, keep in mind that you won't be able to use widgets in that other 
window (it might work, but it has good chances to fail at some point)

On Thursday, November 8, 2012 11:47:14 AM UTC+1, Sarjith wrote:
>
>
> I am trying to achieve something like below through GWT (below code is 
> javascript).
>
>
> function openWin() {
>    var 
> myWindow=window.open('','','width='+screen.width+',height='+screen.height+',left='+screen.width);
>    myWindow.document.write("<p>This is 'myWindow'</p>");
>    myWindow.document.write("<span id='span'></span>");
>    myWindow.document.close();
>
>    myWindow.document.getElementById('span').innerText = 'something';}
>
>
>
> How can I achieve this in gwt, when i try this javascript code itself, 
> inside my gwt project, left='+screen.widthis not seems to be working in 
> FF and myWindow.document.getElementById('span').innerText = 'something'; is 
> not seems to be working in chrome. correcting them in javascript is also 
> fine for me, as long as it works perfect for both FF and chrome.
>
> Regarding using the PopupPanel of gwt, that also wouldnt help me. As far 
> as I know, PopupPanel can't be poped out of the page. In my scenario, the 
> new window should be opened in my secondory display (which can be achieved 
> with current js code. using code
> 'width='+screen.width+',height='+screen.height+',left='+screen.width. (If 
> I am wrong please guide me to know about such property of PopupPanel.
>
> --
> Sarjith
>            
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/9EsT36oEnAMJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to