Hi Vaibhav,
Thanks to your idea.
I implemented the same. But again the label now is not shown properly.
After few seconds again the page is busy with loading data. And the
entire page is goes off with blank with giving impression that
hanging.. and once the data is loaded I am getiting the Grid visible.
Still I cant prevent the impact of grid data loading while showing the
label.
Here is how I am dealing with it..
[code]
package com.ibsplc.idaho.thinclient.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.user.client.ui.*;
public class Thinclient implements EntryPoint{
/**
* This is the entry point method.
*/
Grid flexTable = new Grid(101,87);
final Label img = new Label();
public void onModuleLoad() {
flexTable.setVisible(false);
img.setStyleName("ProgressImage");
RootPanel.get().add(img);
final DBFetchAsync dbFetch = (DBFetchAsync) GWT.create
(DBFetch.class);
ServiceDefTarget endpoint = (ServiceDefTarget) dbFetch;
endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() +
"DBFetch"); // for GWT eclipse launch
AsyncCallback asyncCallback = new AsyncCallback(){
public void onSuccess(Object result) {
try {
//here comes the code for Loading the
data into the Grid.......
//after data load is completed
RootPanel.get().remove(img); //removing
the Label which has the
Progressbar image
flexTable.setVisible(true); //showin
the Grid
RootPanel.get().add(flexTable);
//Adding to the Root panel
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
public void onFailure(Throwable caught) {
Window.alert("Failed to get quote " +
caught.getMessage());
};
};
flexTable.addStyleName("FlexTable");
try {
dbFetch.setGridDataInfo(asyncCallback);
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
}
[/code]
Kindly advise whether its correct way of doing it. And how I can
achieve my requirement?
Thanks
Suren
On Apr 8, 6:01 pm, "vaibhav" <[email protected]> wrote:
> Hi,
> If you are using the GIF image using the image object you can not show the
> GIF image as the GIF image is divided in the frames. You need to set the
> image to a widget (recommended label) using the css.
>
> If you are setting the progress bar image on any widgets like label or panel
> through css then you need to set the size of the widgets. Typically the
> width and height in pixel. Do not forget to set the size in pixel.
>
> If you have set the pixel size too then after showing the image you need to
> relax the GUI using the timer. Like
>
> Show();
>
> Timer timer = new Timer(){
>
> Public void run(){
>
> Do next task
>
> }
> };
>
> timer.schedule(1000);
>
> Show is the way to show the image in popup. Here you can use your own way to
> show GIF image and in timer run add your next logic to load the grid.
> Schedule it to 1000 ms and the work is done.
>
> Regards
> Vaibhav Saxena
>
>
>
> -------Original Message-------
>
> From: alex.d
> Date: 4/8/2009 1:40:31 PM
> To: Google Web Toolkit
> Subject: Re: IE doesnt show my progress bar when the data loads in to my
>
> Grid
>
> You can't "start antother thread" from javascript. And though it's a
> singlethreaded environment your animation isn't "moving" probably
> because browser is busy with filling the data. You can show some
> static text "Loading..." and then load your data.
>
> On 8 Apr., 07:22, Suren <[email protected]> wrote:
> > Hi All,
>
> > I am loading 100x100 values into the cells of a Grid from the DB. Its
> > taking some time to show the Grid in IE.
>
> > So thought of showing a progress bar during that time instead of
> > showing blank page to the user.
>
> > So I am trying to display a progressbar.gif image during the data
> > load.
>
> > But the problem here is that, still the progressbar is not shown. Its
> > showing hourglass mouse cursor in the IE and showing nothing and looks
> > like the loading page.
>
> > what I am doing wrong here? do I need to have a seperate thread to
> > show the image??
>
> > Or instead of this approach, I expect if anything else is better way
> > of doing it from the group.
>
> > Kindly advise
>
> > Thanks
> > Suren
>
>
>
> faint_grain.jpg
> 1KViewDownload
>
> imstp_animation_monkey_en_020908.gif
> 55KViewDownload- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---