Hey Shelley,

a bit of further information is missing but may it be that you issue
an RPC between infoLabel.setText("Beginning...."); and
infoLabel.setText("Completed....");?

If so you simply forgot the async nature of GWT RPC. Your code in
onClick(...) will not sort of stop or wait until the RPC finishes and
continue afterwards. That's why infoLabel.setText("Completed....");
will be immediately executed after infoLabel.setText("Beginning....");
and you're simply "way to slow" to see it.

What you could do instead is call infoLabel.setText("Completed....");
in your onSuccess(...) in case I'm right with RPC or in the callback
of whatever request you do for your search operation.

Andreas

On 7 Jul., 10:22, Shelley <[email protected]> wrote:
> hello all:
>    i came across a strange problem which seems quite simple:
>
>    i have a button and a label on a panel, the button has been
> registered a listener:
>
>   Button searchButton = new Button( "Search" );
>         searchButton.addClickHandler( new ClickHandler()
>         {
>             @Override
>             public void onClick( ClickEvent event )
>             {
>                 infoLabel.setText("Beginning....");
>                 //do a search operation here which will take more than
> 5 seconds...
>                 infoLabel.setText("Completed...");
>             }
>         } );
>
> that's all, but i never see the "Beginning....“ on the label, but only
> see the "completed...", seem the label will not refresh it's text
> until onClick is  finished? how can i achieved the function that
> display "beginning..." first and "Completed..." when the operation
> completed?
>
> thanks in advance.
>
> -Shelley

-- 
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.

Reply via email to