Monday, February 11th, 2008

GWT Ext 2.0 Released

Category: GWT, Sencha

When making ChartMaker on the plane, I was tempted to use GWT Ext, but it didn’t support Ext 2.0 yet so I held off. However, at JavaPolis I was told about the work being done by Sanjiv Jivan, and he has just released GWT Ext 2.0 which “is a powerful widget library that provides rich widgets like Grid with sort, paging and filtering, Tree’s with Drag & Drop support, highly customizable ComboBoxes, Tab Panels, Menus & Toolbars, Dialogs, Forms and a lot more right out of the box with a powerful and easy to use API.”

Sanjiv actually added a partial port of Chart Maker as one of the demos. There are a couple of nice touches in there. The one that jumps out at me is the way you add data. Instead of my cheesy textarea, he added a really nice data entry system. Thanks Sanjiv!

If you are a GWT developer that loves staying in Java land, you can continue to do so knowing that you will be getting fantastic looking widgets via Ext 2. A nice pairing.

GWT Ext 2

Posted by Dion Almaer at 8:30 am
14 Comments

++++-
4.3 rating from 97 votes

14 Comments »

Comments feed TrackBack URI

We have just completed porting a GWT-Ext 0.9.3 application to use GWT-Ext 2.0. The apis are very clean and the performance benefits are amazing. If you are using GWT, GWT-Ext is the way to go…
Thanks Sanjiv for the amazing work you have done.

Comment by John Rezig — February 11, 2008

Froze my computer as it was loading the application. I’m currently running Firefox 2 on an Intel Core 2 Duo 2.33 Ghz, 2GB of ram. :P

Comment by MezZzeR — February 11, 2008

Had to kill -9 :(

Comment by MezZzeR — February 11, 2008

I tired it out and it works fine. The site must have slowed down due to the increased traffic from ajaxian

Comment by John Rezig — February 11, 2008

looking good, but wake me up when they have modal dialogs. i mean: come on. it’s been so long and still no decent modality handling?

Comment by Lon42 — February 11, 2008

If you’re interested in Modal Dialogs in a strongly types language developing server-side, follow my signature ;)
No Java though unfortunately, unless you count J# on Mono/Linux for Java that is… ;)

Comment by polterguy — February 11, 2008

MezZzeR, please try accessing the demo again. I got the host provider to configure the web server to handle the traffic.

Lon42, any Window can be made modal by calling setModal(true). For example one could set the Window in the LayoutWindow sample to be modal by this property. I’ll update the Showcase to include an example of this but you could have a look at the MessageBox sample which illustrates modal dialogs.

Comment by sjivan — February 11, 2008

Impressive!! The work you’ve done looks really great Sanjiv. I’ll use it soon for a project. But why are you still working alone on this project? Why doesn’t a community help you?

Comment by efattal — February 11, 2008

GWT-Ext certainly looks very impressive, but it’s not a good example at the moment for startup speed using GWT, because it wraps the already large extjs library. MyGWT (http://mygwt.net) is a an example of an ExtJS port to Java, so it gets all the benefits of the GWT compiler optimizations. The downside is it lacks the full variety of widgets that ExtJS2.0 has.

GWT 1.5 (unreleased) has a new set of compiler optimizations and a new interface to third party Javascript that should mitigate some of the inefficiencies of GWT-Ext being a wrapper however.

Kudos for the massive amounts of work that GWT-Ext though.

Comment by cromwellian — February 11, 2008

I wonder how much overhead is generated by this wrapper library. The ExtJS 2.0 wrapper library for Milescript (milescript.org) generates zero overhead due to the unique nature of external classes in Milescript. Google did download our compiler recently though, so I wonder if we’ll be seeing a similar method for wrapping external libraries in GWT 1.5 now…

Comment by wgyouree — February 11, 2008

The issues surrounding GWT wrapping native JS code are more complex. Milescript doesn’t have a hosted mode, and this complicates matters for GWT’s native interface design. GWT supports the kind of mapping to JS objects that Milescript has, but Java programmers generally prefer idiomatic Java, so as a result, Java wrappers around JS libraries usually are for more complex than mapping method names in Java to method names in JS. GWT-Ext for example, does quite a bit more than map method names.

GWT 1.5 brings a really aggressive set of optimizations combined with a new external interface design that reduces not only simple mappings to zero overhead, but also reduces even more complex mappings to near zero overhead.

You can see the design here: http://code.google.com/p/google-web-toolkit/wiki/JavaScriptObjectRedesign, I don’t really think Milescript influenced it that much, since the issues in the redesign have been debated on the GWT list for about a year.

Comment by cromwellian — February 11, 2008

@cromwellian
One of the things that made the our ExtJS wrapper generate zero overhead was Record Types, which are essentially typed-JSON notation. Record Types came from the ECMAScript 4 spec, with some tweaks to make it work in a Java style language like Milescript. I noticed in the example code for the GWT no-JSNI library that when using JSON notation it was given as a String. Record Types helped us a lot when wrapping ExtJS 2.0 because ExtJS relies so heavily on configurator objects which are just JSON objects.

I’m wondering how this could be handled in idiomatic Java. Does GWT 1.5 have a better way of handling JSON notation? or is this the “complex mappings” you were talking about?

Comment by wgyouree — February 12, 2008

I don’t know about GWT-Ext2.0, but in the 0.9.3 version you’d write code like:

FooWidget b = new FooWidget(new FooWidgetConfig() {
{
setLabel(“foo”);
}
}

The extra boilerplate is a limitation of Java. What you have here is an anonymous inner class with an anonymous initializer/constructor that calls setLabel(“foo”), which is really nothing more than “{ label: ‘foo’ }” in JSON notation. There’s probably a JSNI method somewhere on FooWidget that creates a native ExtJS foowidget and passes the JSONized FooWidgetConfig. The 1.4 compiler isn’t spiffy about to reduce all this boilerplate down to its essense, the 1.5 compiler is alot closer. (but not the nirvana we want yet)

-Ray

Comment by cromwellian — February 12, 2008

In 2.0 the config classes are no longer there. You create widgets just like you create GWT widgets.

FooWidget b = new FooWidget();
b.setLabel(“xxx”);

Disclaimer: My name closely matches the JQuery’s author ..but I not him.

Comment by John Rezig — February 12, 2008

Leave a comment

You must be logged in to post a comment.