Opening a new Window with a Widget in GWT

450 views
Skip to first unread message

trippledes

unread,
Nov 12, 2010, 5:05:39 PM11/12/10
to Google Web Toolkit
Hi all,

Before you start shooting me down i have checked for answers and i
have googled till my fingers bled but i havent been able to find a
simple, concise answer. So im asking again for all those that might
have this problem.

Question: how to open a new window with a formpanel in side.

Context: i have an app that lists lots of items, i want someone to
edit an entry, i want a new window to open so they can edit properties
then hit save. A standard thing you find in a lot of applications.

Architecture: I have one client module called UI, it has a dozen
classes that draw widgets and fill a main area when selected from a
menu. I have a single html page called UI.html which has the tag in
the head. Thats it.

Options Ive Seen

1. Call Window.Open() but you need to define a html file. I
dont have one. I can create an empty one but how do you inject a
widget in to it ?

2. use jsni $wnd to create a new window and get a reference to
it. But how do i inject a form panel into it ??

3. use a popuppanel/dialog panel. They look sucky - plus if
opening a window through JS is quite simple i would expect it to be in
gwt.

Maybe im miss understanding how to use GWT i dont know.

Any help would be appreciated even if its to correct my application/
thinking of GWT

Thanks

Steve Moyer

unread,
Nov 30, 2010, 8:15:19 AM11/30/10
to Google Web Toolkit
I've been wondering the same thing ... though it certainly seems like
the accepted practice is to use the PopupPanel and DialogPanel. In
fact, I can't remember seeing a GWT application that used more than
one browser instance or tab. In theory, you can style the GWT panels
to look more like separate windows, but the way they're implemented,
you can't drag them off the main window (which can be confusing to a
user).

smoyer

John Rellis

unread,
Nov 30, 2010, 10:09:29 AM11/30/10
to google-we...@googlegroups.com
I tend to agree, the GWT support for windows is a little contrived.

We have used dialogs to achieve a window-esque approach.

We actually created a couple of applications using SmartGwt that required heavy utilization of windows, such as popping up move-able charts and forms to create users etc. 

SmartGwt is only suited for large apps IMO though due to its enormous footprint.  It is also all JSNI... not sure how people feel about this.

Maybe check out some widget libraries like http://www.gwtwindowmanager.org/

Hope this helps!


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.




--
John Rellis
@johnrellis

Brian Reilly

unread,
Nov 30, 2010, 12:52:09 PM11/30/10
to google-we...@googlegroups.com
I'd create a separate HTML file that hosts the application module (or a different module). You can inspect the URL and/or history token as appropriate to decide what widget to view and any data you may need to preload it with. The trick then is that I assume you'd want to communicate events back to the originating window. I'm not sure how to accomplish that, but I imagine that there's some way to do it.

I think you have to decide if you want the widget to be modal or not. If so, you'd be better off using a dialog in the application window and there'd be no need for typical window controls. On the other hand, if it's not modal, a separate window (that the user can then switch between and close individually) may be more appropriate.

- Brian
Reply all
Reply to author
Forward
0 new messages