Luca,Can you post the code for your WCSX Page too?
Marty
Dear Marty,
I thank you very much for attention.
I am demoralized because after having spent much time to study Progressbar examples still I am not able to get it working.
I made this example using Rick's WCSX and PRG, I tested to copy a big 50 Mb file for 10 times, but the Progressbar does not progress during copy process, instead the Progressbar shows 10% at the end of copy process. I do not understand what is wrong.
FUNCTION test_click
FOR m.counter=1 TO 10
Session.SetSessionVar("simulate_Counter",TRANSFORM(m.Counter))
ERASE d:\bo.dbf
COPY FILE c:\temp\bo.dbf to d:\bo.dbf
endfor
ENDFUNC
* progressbar_Page :: StartProcessing
****************************************
FUNCTION StartProcessing_Callback()
Session.SetSessionVar("Simulate_Counter","0")
*** generate an ID to pass back to the client so
*** the client and server have context
lcId = SYS(2015)
Session.SetSessionVar("progress_Id",lcId)
Session.SetSessionVar("progress_StartTime",TRANSFORM(SECONDS()))
this.test_click
RETURN lcId
ENDFUNC
* progressbar_Page :: UpdateProgress
****************************************
FUNCTION UpdateProgress_Callback(llCancel)
lnCounter = VAL( Session.GetSessionVar("simulate_Counter") )
LOCAL loArgs as ProgressEventArgs
loArgs = CREATEOBJECT("ProgressEventArgs")
*** so we have to parse 'true'
IF llCancel
loArgs.Cancelled = .t.
loArgs.Percent = lnCounter
RETURN loArgs
ENDIF
IF lnCounter >= 100
loArgs.Completed = .T.
loArgs.Percent = 100
RETURN loArgs
ENDIF
*** OPERATIONS. FOR EXAMPLE, YOU COULD USE wwWebAsyncRequest
*** TO OFFLOAD PROCESSING TO ANOTHER PROCESS AND CHECK FOR
*** COMPLETION ON THE EXTERNAL PROCESS
loArgs.Percent = lnCounter
RETURN loArgs
Hello Luca,Take a look at the sample on the Web site here: http://www.west-wind.com/wconnect/webcontrols/progressBar.wcsx
This sample uses Ajax callbacks to provide what it seems you are wanting. Go to the bottom of the page and use the Show WCSX button and the Show PRG button to see the code in both the Web Page and the Code Behind page.
Perhaps this will help some...
Marty
![]()