A thorough handbook on how to build applications with the Google Web Toolkit (GWT) furnishes coverage of the updated features, tools, and techniques of the latest version of GWT and includes a detailed study of five applications built with GWT to reveal development patterns, techniques, and subtleties used throughout the design and development process. Original. (Intermediate)
All HTTP responses require the client to initiate them, even those made using AJAX. But GMail's chat feature is able to receive messages from other users, even when I'm just sitting in my comfy computer chair watching but not interacting with the browser. How did they do it?
Yep Comets is correct. Google Web Toolkit Applications by Ryan Dewsbury explains how to create a Comets based Instant Messenger application in chapter 9.
I am trying to learn GWT, but have no clue about the same.
I have a java background and have all through my years of experience worked on Struts, Spring, Grails and such MVC Frameworks.
I am to learn GWT for a project and am looking for help as to how I can go about it.
Could someone give me an idea of the learning curve when it comes to a technology like this.
Thanks in advance!
The best way to start learning GWT is to go through this tutorial.
Some good books on GWT :
Sencha is also a good way to learn GWT
The GWT documentation is a good starting point and watch the Google I/O presentations on GWT, start with the most recent it covers the newer features.
But if you (also) want to read a book make sure it's a recent version. GWT changes fast, and therefor most books are rather outdated. Actually some of the newer GWT features are not or very briefly covered in currently available books.
Here are 3 books which are more recent:
Google App Engine Java and GWT Application Development (While this book covers also Google App Engine, it contains a lot of usefull examples)
I would avoid starting with Ext GWT, as it's a framework build upon GWT. Just learn the GWT basics and then decide if you want to use and additional framework.
I am having a difficult time understanding the Pyjamas/GWT event handling system. I am currently using the latest 0.8 Pyjamas in order to test. I am not sure of what the best event handling structure would be as I have never done GUI programming.
I haven't had much luck with the documentation I've found thus far. Does anyone know of a good reference for Pyjamas or GWT?
My main difficulty comes from understanding where listeners such as onClick, onMouseleave, etc are coming from? How are they triggered? Where are they defined? Do I define them?
What is the layered structure for the event handling system?
I know these are very general questions but I'm really just looking for a point in the right direction.
Thank you and I appreciate any help given.
I would suggest you study source in examples folder. Start with this http://pyjs.org/book/output/Bookreader.html#Getting%20Started
There are some links which has been helpful for me: http://gwt.google.com/samples/Showcase/Showcase.html
Also in examples folder there is a great example called
showcase which gives you all API and some helpful code samples
since API is similar you can always check them books (especially helpful for understanding callback etc..) :
for Django and Pyjamas http://www.derekschaefer.net/2011/02/08/pyjamas-django-pure-win/
However i agree there is a great need for better introduction tutorials beyond the hello world example. I'm struggling with it myself. Good luck
ps. I've created small callback example that seems to work. I would be greatfull if people correct me here and edit this example to be of more use for people. All im trying to do here is to have navigation with 2 pages (represented by 2 classes: Intro and Outro )
import pyjd from pyjamas.ui.VerticalPanel import VerticalPanel from pyjamas.ui.RootPanel import RootPanel from pyjamas.ui.SimplePanel import SimplePanel from pyjamas.ui.DockPanel import DockPanel from pyjamas.ui.Hyperlink import Hyperlink from pyjamas.ui.Button import Button from pyjamas.ui.HTML import HTML from pyjamas import Window class Site(SimplePanel): def onModuleLoad(self): SimplePanel.__init__(self) self.panel = DockPanel() self.intro = Intro() self.outro = Outro() self.index = HTML('index') self.curPage = self.index vp=VerticalPanel() vp.add(self.index) self.link1 = Hyperlink('menu item 1') self.link2 = Hyperlink('menu item 2') self.link1.addClickListener(getattr(self, 'onLINK1')) self.link2.addClickListener(getattr(self, 'onLINK2')) self.panel.add(self.link1, DockPanel.WEST) self.panel.add(self.link2, DockPanel.WEST) self.panel.add(self.index, DockPanel.CENTER) RootPanel().add(self.panel) def onLINK1(self): self.panel.remove(self.curPage, DockPanel.CENTER) self.panel.add(self.intro, DockPanel.CENTER) self.curPage = self.intro def onLINK2(self): self.panel.remove(self.curPage, DockPanel.CENTER) self.panel.add(self.outro, DockPanel.CENTER) self.curPage = self.outro class Intro(SimplePanel): def __init__(self): SimplePanel.__init__(self) self.vp = VerticalPanel() self.html = HTML('This is intro') self.button = Button('click me', self) self.vp.add(self.html) self.vp.add(self.button) self.setWidget(self.vp) def onClick(self): Window.alert('onClick Intro') class Outro(SimplePanel): def __init__(self): SimplePanel.__init__(self) self.vp = VerticalPanel() self.html = HTML('This is outro') #we can do it this way self.button1 = Button('click me1', getattr(self, 'onBUTTON1')) self.button2 = Button('click me2') #or set up listener self.button2.addClickListener(getattr(self,'onBUTTON2')) self.vp.add(self.html) self.vp.add(self.button1) self.vp.add(self.button2) self.setWidget(self.vp) def onBUTTON1(self): Window.alert('hello from button1') def onBUTTON2(self): Window.alert('hello from button2') if __name__ == '__main__': pyjd.setup('./Site.html') app = Site() app.onModuleLoad() pyjd.run()