background preloader

GWT

Facebook Twitter

Other pearltrees

Google I/O 2011: Kick-Ass Game Programming with Google Web Toolkit. How to handle JS events in GWT. I had a requirement where I needed to detect a change in a TextBox as data is entered in a form. The first thing I tried was using the KeyUpEvent. It seemed reasonable enough and worked great. However I soon tried to copy and paste into one of the TextBoxes on the form and it became apparent that I had a problem.

While I was looking for KeyUpEvents and that worked OK, a paste to the TextBox was not detected. So next I tried using ValueChangeEvent as well as the KeyUpEvent. The ValueChangeEvent did work but not entirely as I needed. The problem is that the ValueChangeEvent is not fired until the TextBox that data is entered into loses focus. I starting looking for alternatives and came across the onPasteEvent. The onPasteEvent can be detected by GWT but there is not a handler for it. Or so I thought.

Opera has an oninput JavaScript event that can be used to detect changes much like the onPasteEvent but GWT does not support this event. Step 1: Define New Event Option 1 – Use UIBinder. Getting to really know GWT, Part 1: JSNI. The next and hopefully last release candidate for GWT 1.5 is almost upon us. In anticipation, we'd like to really crank up the excitement level and, well, the sheer geek factor of this here blog. If you are new to GWT, you may be wondering what all the excitement is about. Why is GWT different from other framework-style solutions?

GWT is more of a tool chain and a baseline technology rather than a particular application framework. So, although GWT has lots of libraries, you can use as many or as few as you find useful. So, high-level, why should you consider using GWT for your next big web app? Ajax applications, when designed well, can by their nature provide a much better user experience than server-centric approaches for many important kinds of applications.

Before we dive into the technical details, one last note. Why does GWT center on the Java language and tools? GWT's JavaScript Native Interface (JSNI) You can easily combine handwritten JavaScript directly into GWT code.

Libs

Simon-watiau/simplelocation - GitHub. What's new. Web Toolkit - Google Code. GWT Application Development for the iPhone. In our not-so-humble opinions, we think that the Google Web Toolkit (GWT) and the Apple iPhone are two very cool technologies. Because we're all highfalutin computer-scientist types (as well as being irrepressibly geeky) we wanted to see what happens when you mix them together.

Would it be like peanut-butter and chocolate, or hot-sauce and poison ivy? Our approach was to build an application that primarily targets the iPhone and to use that as a test-bed for new ideas. So what kind of application should we build? The application should: demonstrate a well-defined purpose that is useful to developers using GWTtake advantage of the always-connected iPhone platformpresent a UI that is familiar to iPhone users and geared towards information presentationdemonstrate integration between GWT and other Google technology And so the GWT Feed Reader was created.

Enjoy. Developer's Guide - Layout Using Panels - Google Web Toolkit - Google Code. Panels in GWT are much like their layout counterparts in other user interface libraries. The main difference is that GWT panels use HTML elements to lay out their child widgets. Panels contain widgets and other panels. They are used to define the layout of the user interface in the browser. Basic Panels RootPanel FlowPanel A FlowPanel is the simplest panel.

HTMLPanel This panel provides a simple way to define an HTML structure, within which widgets will be embedded at defined points. FormPanel When you need to reproduce the behavior of an HTML form (e.g., for interacting with servers that expect form POST requests, or simply to get the default form keyboard behavior in the browser), you can use a FormPanel. ScrollPanel When you wish to create a scrollable area within another panel, you should use a ScrollPanel. PopupPanel and DialogBox Use these two panels to create simple popups and modal dialogs. Grid and FlexTable Layout Panels RootLayoutPanel LayoutPanel DockLayoutPanel SplitLayoutPanel Animation. Vendors' CSS properties. Literal. Documentation for the GWT 2.0 release of CssResource can be found on the GWT Developer's Guide website.

See also the CssResourceCookbook and StyleInjector. Primary Compatibility with non-GWT-aware CSS parsers (i.e. any extensions should be valid CSS syntax) This does not imply that the stylesheet would necessarily make sense if you just displayed it in a browser Syntax validation Minification Leverage GWT compiler Different CSS for different browsers, automatically Static evaluation of content Secondary Basic CSS Modularization Via dependency-injection API style Widgets can inject their own CSS only when it's needed BiDi (Janus-style?) CSS image strips "Improve CSS" Constants Simple expressions Tertiary Runtime manipulation (StyleElement.setEnabled() handles many cases) Compile-time class-name checking (Java/CSS) Obfuscation Server-side manipulation All features in CssResource must be implemented with compile-time and runtime code only. Constants (Working) @def myIdent 10px;.myIdent { ...}

UiBinder & <g:HTML>