• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to implement these tricks in GWT?

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
How to display an indicator if a link (for example) is clicked?
And how to display a message while the application is being loading (something like GMail loading message)?
Thanks for help.
 
author
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,

If you mean something like the "standard" Ajax spinners or GMail Loading mark and the like to indicate something is happening, then I generally build (well, resuse...) a new composite widget, something like:

public class WorkingWidgetBase extends Composite{

Widget workingWidget;
FlowPanel working = new FlowPanel();

public void start(){
working.setVisible(true);
}

public void stop(){
working.setVisible(false);
}

public WorkingWidget(Widget theWidget, boolean initiallyVisible){
working.add(theWidget);
working.setVisible(initiallyVisible);
initWidget(working);
}
}

Then I can add it to my application by adding it to the page:

WorkingWidget working = new WorkingWidget(new Label("Working"), false);
RootPanel.get("WorkingSlot").add(working);

using it along the following lines:

RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);

try {
working.start();
Request response = builder.sendRequest(null, new RequestCallback() {
public void onError(Request request, Throwable exception) {
working.stop();
//Do something else
}

public void onResponseReceived(Request request, Response response) {
working.stop();
//Do something else
}
});
} catch (RequestException e) {
}
}

Hope that helps!

//Adam
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, any ideas how to create widgets like "Labels" or "Invite a friend" of GMail?
 
Adam Tacy
author
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by John Todd:
Ok, any ideas how to create widgets like "Labels" or "Invite a friend" of GMail?



As a very basic view, they both look like they would fit within the new GWT RC1.4 DisclosurePanel (which would give the arrow, the title and the hidden/shown content- you would use styling to set the border and colours - and if you wanted the round corners, then that is some more CSS trickery that you can find on the web).

The contents of that DisclosurePanel would of course be different:

* "Labels" would probably be a VerticalPanel containing GWT Labels, these Labels would probably be created from data fed from a server call;
* "Invite a friend" would be a simple form.

At least that is how I would probably make my first attempt.

//Adam
 
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adam Tacy
I appreciate the effort taken to give an answer,

Please do use code tags.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Salvin,
When I asked this question back in the 2007, no code tags were available (AFAIR)
 
salvin francis
Bartender
Posts: 2911
150
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
WOW !!!
my bad
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic