This post is from Developer Kate Kinnear.
While I'm sure this blog will feature many posts about GWT in the future (I've got a few choice rants already lined up), I'm going to start by featuring a few of the quirks we found while switching our UI from ExtJS to GWT. I want to start out by saying that I love GWT. GWT has been very good to us. It allowed us to create a system with a UI look-and-feel that we could customize to exactly the way we wanted it. It gave us the Editor framework, which basically allows us to just hand a proxy to the UI and it handles filling in the fields, and updates to the proxy made when the user edits those fields. ExtJS was fine for a standard business application, but we were really looking to completely overhaul our UI. We also loved the idea of working entirely in Java, as our back-end is also written in Java.
However, there are a few things to be aware of when switching to GWT:
- There is quite a bit of boilerplate code, especially around the Editor framework. This wouldn't be a big deal by itself, but combined with a lack of good, complete examples, these extra necessary classes get confusing.
- There is a learning curve. While there is documentation, there aren't any good front-to-back examples of how to use GWT's frameworks, like the RequestFactory and the Editors. Code snippets can only get you so far, especially when there are so many classes that need to interact. There are also a lot of odd quirks to GWT that are not obvious, and can really slow down development until you get a handle on them.
- ExtJS has a LOT of extensions available through its community. If you can't find what you're looking for, chances are that someone else has already created something you can use. GWT has some extensions, but I've found that they're not comparable in quantity or quality to those available from the ExtJS community. I'm sure this will change as GWT increases in popularity and use, but it is not quite there yet. For example, I spent yesterday morning creating a Date/Time picker for GWT that could be used with the Editor framework. This seems like a common widget, but I was unable to find an existing solution anywhere that met these requirements. I ended up extending the functionality of a Date/Time picker from another widget library to get what I wanted.
- The ExtJS community is not perfect, but it is much more mature than GWT's community. Like all internet communities, the ExtJS forums have their share of trolls and snobby super-users. If you've ever visited these forums, you know who I mean: that guy who answers every question with a link to the documentation. It's not even a specific page in the documentation, just a general link to the documentation page. You can practically see his sneer. But generally the community is very helpful, and will go out of their way to help you find a solution to your problem.
- Following from the previous point, there are going to be a lot of things you are going to have to just do yourself in GWT. I think in many ways we were spoiled by ExtJS. The biggest shock we had during the switch was GWT's lack of events. ExtJS has built-in events for EVERYTHING, every possible state change you can imagine for every widget. Other functionality we had to find work-arounds for (that was simply available in every ExtJS widget) included:
- masking (things like pop-ups have masking built in, but there was no straightforward way to mask other widgets),
- tab order (some widgets you'd expect to have tab order just don't)
- adding arbitrary widgets to a grid (we had a lot of issues getting a clickable icon in a grid).
This list goes on, and these are some of the issues I'll be discussing in the future. I plan to write more GWT posts in the future to clarify some of the confusing GWT quirks, and provide more complete examples of working with GWT's Editor and RequestFactory frameworks.