Hi Mr.Rakesh,

I've created a deckpanel with an image(loading image) and a flextable
attached to it.

Initially the image widget will be shown until the flextable is
finished populating and rendering its data.

The code works, but the image (loading image) icon was freezed while
the flextable is populating. It stop while the flextable is rendering
its data. Its like the whole system stopped when the flextable is
rendering. Did I miss something?

Here is part of my code,

flexTable = new FlexTable();
Panel flexPanel = new Panel();
flexPanel.add(flexTable);

Image loadingImage = new Image();
loadingImage.setUrl("images/loader.gif");
loadingImage.setSize("32", "32");

Panel imageLoaderPanel = new Panel();
imageLoaderPanel.add(loadingImage);

deckPanel = new DeckPanel();
deckPanel.add(flexPanel);
deckPanel.add(imageLoaderPanel);

if(loadingFinished == false) // loadingFinished is a boolean flag set
to false initially.
   deckPanel.showWidget(1);

populateTableFromDB(); // this is where my flextable will be populated
using the data retrieved from the database using async callback.

    .
    .
    .
    .

//inside the populateTableFromDB(){

//assuming where already got the list of data we need to populate the
flextable

public void onSuccess(Object returnValue) {
        for (int i = 0; i < objectDB.size(); i++) {

       // this is where i set the data to my flextable.

        }

        loadingFinished = true;
        if(loadingFinished == true)
             deckPanel.showWidget(0);
        }
}

Thanks,
Karl Chan


On Sep 8, 12:23 pm, Karl <[EMAIL PROTECTED]> wrote:
> Thanks a lot Mr.Rakesh. I'll try to implement it that way.
>
> On Sep 7, 11:46 pm, rakesh wagh <[EMAIL PROTECTED]> wrote:
>
> > Quite a few stratagies:
> > 1. Use a deck panel, add your table and loading icon to this deck
> > panel. Initially show the deck panel. Once the last table rendering
> > statement is executed, flip the deck to show your table widget now.
> > 2. Have a loading image in a convenient place(bottom, middle or top of
> > the flextable). While the system is computing, let the image be
> > visible, once the last stmt is executed,
> > loadingImg.setVisible(false).
>
> > Here is a tip: Fetching data through RPC is a async operation while
> > rendering your table, that is DOM manipulation through js is a single
> > thread blocking operation. In the later scenario(at least in IE) your
> > animated loading gif will freeze and so will the browser if you are
> > adding lot of rows and widgets to the flextable. Try to design your
> > tables as sleek as possible. For more information see the tables in
> > gwt incubator.
>
> > Hope that helps.
> > Rakesh Wagh
>
> > On Sep 7, 9:05 am, Karl <[EMAIL PROTECTED]> wrote:
>
> > > Good Day To All,
>
> > > How can I create a busy/loading icon while my flextable is being
> > > rendered? By the way, my flextable is consist of comboboxes that
> > > contain a large amount of data so while the page is being rendered,
> > > there is a slight delay of displaying the contents of the flextable.
>
> > > Thanks,
> > > Karl Chan
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
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