Necuima (14) [Avatar] Offline
#1
Hi Bear,

Am now learning about the progress bar capability. Do you have PHP versions of the Java applets CheckProgressServlet.java and LengthyOperationServlet.java?

I have never used java servlets so have no idea how to use them.

Any help will be appreciated, Cheers from Oz, Necuima.
bear.bibeault (675) [Avatar] Offline
#2
Re: Chapter 11 Progress Bar Example
I'm afraid not. I haven't used PHP I'm many many years.

For the progress bars the back-end is fairly simple. If you look at the HTTP API it should be fairly easy to pull something together in any server-side language.
Necuima (14) [Avatar] Offline
#3
Re: Chapter 11 Progress Bar Example
OK, thanks for getting back to me.

Cheers.
bear.bibeault (675) [Avatar] Offline
#4
Re: Chapter 11 Progress Bar Example
No problem. It'd be great if you could post whatever you come up with here to help others out!
Necuima (14) [Avatar] Offline
#5
Re: Chapter 11 Progress Bar Example
Hi Bear, as requested, FYI I wrote two small PHP scripts. The first initiates an update to an MySQL database table record which just starts incrementing a counter at half-second intervals up to a control limit. The second script just reads that MySQL table record to see what the count is and calculates the percentage completed from that. It all works fine in Firefox and Chrome and sort-of in IE9.
The problem in IE9 is that the value of the percentage completed does not show, either during the progress nor at its completion, but the progress bar itself displays OK. This same problem is also apparent in your remotely executable version (page 36smilie. Can you offer any suggestions? It is the 'valueDisplay' statement that is not displaying the value. Thanks in anticipation for your advice. Cheers from Oz.
bear.bibeault (675) [Avatar] Offline
#6
Re: Chapter 11 Progress Bar Example
Hmmm, I haven't had a chance to try any of the example in IE9 yet (not a Windows guy) and cannot think of anything off the top pf my head that could cause that. If I figure anything out I'll let ya know.

From a developer viewpoint, IE9 is a big improvement -- adding lots of support for standards. But I know a lot of Windows people that find it rather buggy and have reverted to Chrome or Firefox after trying out IE9. Hopefully Microsoft is working on these issues.
Necuima (14) [Avatar] Offline
#7
Re: Chapter 11 Progress Bar Example
Hi Bear, I have another question to do with the autoprogressbar method. I 'watched' the net activity when I ran your autoprogressbar-test script (page 36smilie via firebug and I can see that your servlets return just plain numbers. My PHP scripts return plain numbers too, but on page 365 in the $.ajax request, you specify that the dataType is json? I tried changing that to 'text' as one of the options (see page 262) but then my script does not work at all. I also tried just commenting the dataType out (page 262 says that that will not process the return data at all) but that also causes the script not to work. Can you please help me understand this? Thanks and cheers again from Oz.
bear.bibeault (675) [Avatar] Offline
#8
Re: Chapter 11 Progress Bar Example
When the type is JSON jQuery will parse the returned response into data. A type of text will just leave it as text. So anything expecting a number will fail.