5 messages in com.googlegroups.google-web-toolkitRe: Request status information
FromSent OnAttachments
quericaMar 22, 2007 1:29 am 
Adam TMar 22, 2007 5:22 am 
quericaMar 23, 2007 8:39 am 
Adam TMar 23, 2007 8:55 am 
ankostisMar 23, 2007 10:26 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Request status informationActions...
From:Adam T (adam@gmail.com)
Date:Mar 22, 2007 5:22:41 am
List:com.googlegroups.google-web-toolkit

Hej Querica,

There isn't one by default, but they are very easy to build - I don't have my code with me, but from memory I have one built from a deck panel, you pass the constructor two widgets - one to display at rest and one to display whilst working, then there are two methods setWorking() and setRest() which show the appropriate widget. I'll probably show my over reliance on IDEs here, but the code would look something like

public class ProcessRequest extends Composite{

final int REST_STATUS = 1; final int WORKING_STATUS = 1; DeckPanel visibleStatus = new DeckPanel();

public setWorking(){ visibleStatus.showWidget(WORKING_STATUS); }

public setRest(){ visibleStatus.showWidget(REST_STATUS); }

public ProcessRequest(Widget rest, Widget working){ visibleStatus.add(rest); visibleStatus.add(working); visibleStatus.showWidget(REST_STATUS); setWidget(visibleStatus); }

Then you just add the widget wherever you want in the application and use event handling (or tie it into an MVC approach) to show the working status. For example,

HorizontalPanel textPanel = new HorizontalPanel(); ProcessRequest status = new ProcessRequest(new Label("Request Done"), new Label("Performing Request")); TextBox text = new TextBox(); text.addChangeListener(new ChangeListener(){ public onChange(Widget sender){ status.setWorking(); } }); textPanel.add(text); textPanel.add(status);

As I said, I'm away from my IDE so there may be a few typos in the above code, but it gives you the general idea. Hope it helps!

//Adam Co-author of GWT In Action http://www.manning.com/hanson Large Interesting GWT Example: http://dashboard.manning-sandbox.com

On 22 Mar, 09:29, "querica" <quer@googlemail.com> wrote:

Is there any possibility to have a request status information icon? I am thinking of a widget similar to this JSF widget from the Ajax4jsf framework:http://livedemo.exadel.com/a4j-status/ It should keep the user informed whenever an ajax request is processed by the server.

Thanks in advance for any answers!