tags:

views:

60

answers:

1

Hi,
I want to add a progress bar during a gwt-rpc call which shows the percentage of the task completed.Anyone who can help me with a piece of code for the same?
Also I load videos into my client side from the war directory and they take a while.Therefore if I try to play them sometimes the browser goes unresponsive(probably because entire part hasnt loaded) .Is there a way to determine (and hence show the user) when the videos are completely loaded?

+2  A: 

There's a progress bar widget in the gwt-incubator project. However, most of your GWT-RPC calls should be really fast, so I can't imagine the progress bar will have time to appear. Furthermore, there's no way that I know of to get the progress of your GWT-RPC call, you'd have to manually code that feature on the server side.

For example, if you're running a long job, you could create another GWT-RPC call that calls every 30 seconds to find out the status of the running job and updates the progress bar accordingly.

However, for regular GWT-RPC calls, you're best bet is some kind of "loading..." notification. It shouldn't be around for long and is easy to code.

As for your second question, that's not the best way to display video. When you just dump the video file to the user, the user will be required to have that video codec on hand and will be forced to wait until the video has fully downloaded. A better way to display video is either:

  1. Some kind of Flash player that'll stream the video.
  2. An HTML 5 tag that'll only work in modern browsers.

Hope that helps.

Arthur Kalmenson