GWT, ScrollPanel and the iPad.

GWT makes it easy to create a scrolling panel within an HTML driven web site, by using the ScrollPanel class. ScrollPanel itself expands into a div tag containing the overflow attribute; specifying which axes the scroll bars land on translate into overflow-x or overflow-y attributes in the generated HTML DOM object.

And the iPad (and iPhone and iPod Touch) do not allow you to scroll within the overflow tags; the touch-drag gesture only scrolls the entire page.

What this means is if you are putting together a GWT application that you want to work on the iPad, the natural instinct to create a root panel the full size of the screen and tossing in a ScrollPanel area in the lower right that resizes with the window is incorrect. Instead, you are better off generating your GWT code so that it generates the properly sized HTML, and scroll around the GWT application using the window’s scroll bars.

Fun with GWT

Upgrading to v2.0 of GWT under Eclipse, here’s some of the things I encountered:

(1) For some reason my old 1.7.1 GWT projects are hopelessly broken; I can’t seem to debug them. Creating a new v2.0 GWT project seems to work fine. And I haven’t a clue as to why my v1.7.1 GWT projects, when I upgrade them to v2.0, refuse to debug: I’ve tried just switching the current GWT SDK, I’ve tried turning off and on GWT, I’ve tried blowing away the debug configurations–I’ve even tried recreating a new GWT project with the same source kit (which did work under v2.0’s debugger environment), then searching for differences.

Nothing.

The only workaround I’ve found is to create a new GWT project, and copy the sources across from the old GWT project.

(2) IE7 support for the new panel layouts is completely broken unless you change the DOCTYPE declaration from:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

to

<!DOCTYPE HTML>

Beats me why; I’m not into the finer points of HTML compatibility and doctype specifications. But once you make this switch, the new layout panels work as advertised.