Using GWT to Create Widgets for Other Frameworks

Every AJAX framework developer I've spoken to has speculated that you could use GWT to write widgets and other Javascript logic for thier framework. But just how would you go about doing it? At runtime, GWT:

  1. Loads the correct browser-specific generated Javascript file into the browser.
  2. Calls the entry point of the module, which inserts various widgets into the DOM and initialized various objects.
  3. Responds to user action via the various event handlers that have been registered by the module's entry point.


Now other people have hooked things like script.aculo.us into GWT, but the flow of control has been from GWT to the library. What about going the other way, from another framework to GWT? Can we simply create custum GWT widgets and register framework calls and callbacks within 'native' methods of the widget, or should we write static methods and register them in their name-mangled form from the entry point with the window object, there to be called by non-GWT javascript. We certainly want to leverage the browser independent DOM, event and other libraries of the GWT.

Once we've solved the problem of hooking into GWT, will this break our ability to debug in hosted mode? I aim to find out by writing a simple Echo2 widget, first in the usual way, next using GWT. Wish me luck.

Related posts:

  1. Using GWT to Create Widgets for Other Frameworks, Part II
  2. GWT Conference: Creating Widgets (or really, why GWT won’t leak memory)
  3. Using GWT to Write Opera Widgets
  4. Intellectual Frameworks for Classifying Ajax Frameworks
  5. Why Frameworks are Important

Comments: 1 so far

  1. I thought your idea sounded interesting so I whipped up some sample code demonstrating the use of GWT components from native JavaScript. Which presumably implies they can be used from within any native JavaScript framework. Details at http://nubgames.com/index.cgi/gwt/exporting-gwt-widgets-for-other-frameworks.html and full source code is available.

    Comment by Eric Sessoms, Saturday, July 29, 2006 @ 11:13 am

Leave a comment

Powered by WP Hashcash

Launch: Pathfinder Newsletter

    Get a monthly update on best practices for delivering successful software.

    Subscribe via email


    Subscribe via RSS      RSS icon

Topics

Search

WordPress

Comments about this site: info@pathf.com