Chad and Daniel,
Thanks! You got me on the right track. I ended up embedding an
animated "loading" icon (there are thousands of them out there --
can't even remember where I found mine) in the html file for my main
page.
I put the following at the beginning of my onModuleLoad():
final Element ajaxloader = DOM.getElementById("ajaxloader");
DOM.setStyleAttribute(ajaxloader, "display", "none");
(where "ajaxloader" is the id of the "loading" icon in my HTML file)
and then, as you two suggested, I exposed the icon at the beginning of
my click handler (in my case, calling "DOM.setStyleAttribute
(ajaxloader, "display", "block");") before doing the RPC and then hid
it in both the onSuccess() and onFailure() of my AsyncCallback (in my
case, by calling "DOM.setStyleAttribute(ajaxloader, "display",
"none");"). The result can be seen at nicksmap.org (still very much a
work in progress!). That ought to be sufficient to help anyone else
trying to do the same thing with GWT.
Thanks again,
Nick Zaillian
On Jul 31, 5:43 pm, Daniel Jue <[email protected]> wrote:
> I agree with Chad, I have this in my click handler:
>
> display.getButton().addClickHandler(new ClickHandler() {
> @Override
> public void onClick(ClickEvent event) {
> display.getButton().disable();
> display.setStatusText("Please wait while your connection is
> verified...");
> doAuthorize(); //rpc called in this method, and status
> updated with pass/fail messages, button re-enabled
>
> }
> });
>
> On Fri, Jul 31, 2009 at 10:31 AM, Chad <[email protected]> wrote:
>
> > Nick,
>
> > Create your message however you want (DecoratedPopupPanel, GlassPanel,
> > Highlighted text, whatever). Just before you call your RPC, display
> > your message. Then, in both the onFailure and onSuccess methods of
> > your AsyncCallback, hide your message.
>
> > HTH,
> > Chad
>
> > On Jul 30, 8:21 pm, Nick_Zaillian <[email protected]> wrote:
> > > Hey all. This is my first post to the group. I've got a little GWT/
> > > App Engine web app (at nicksmap.org) I've whipped up that maps New
> > > York area craigslist rental listings (yeah, I know, others have done
> > > it already, but all of the other implementations miss A LOT of
> > > listings and have no flagging features...so I thought there was room
> > > for me to go ahead and try to do it right). I've got an RPC that gets
> > > called every time a user drags a map. This function (er....method)
> > > provides data that is then used to populate the map with markers and
> > > correspnding infowindow content. Because of the sheer number of
> > > listings I am dealing with, the RPC can often take a few seconds to
> > > deliver all of its data, during which time it looks to the user like
> > > nothing is happening. I would like to be able to display a loading
> > > icon during this time. I'm sure that this is a pretty trivial thing
> > > to do -- I'm just not sure how to do it, so thought I should ask the
> > > group.
> > > Thanks,
> > > Nick Zaillian
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---