I am studying your ProgressBar, but there is something I do not understand.
I have a long procedure in the Ok_click function. In this example I simulate operations with a FOR ENDFOR cycle, I run UpdateProgress 100 times while usually I would run UpdateProgress just one time for every block of long operations, so I could have about 10 runs of UpdateProgress tipically. However in this example I see the Progress on webpage showing "Waiting to get started", while I see Progress_counter incremented rightly in Session.oData.Vars.
Please what is wrong?
***************************************************************** DEFINE CLASS test_Page as WWC_WEBPAGE OF WWC_WEBPAGE_FILE ***************************************************************** EnableSessionState = .T. FUNCTION Ok_click() this.Startprocessing_callback FOR m.counter=1 TO 100 Session.SetSessionVar("Progress_Counter",TRANSFORM(m.counter)) ENDFOR this.Processcomplete_callback ENDFUNC ************************************************************************************************************ FUNCTION StartProcessing_Callback() *** Create a counter we can increment and store in Session Session.SetSessionVar("Progress_Counter","0") RETURN ENDFUNC ************************************************************************************************************ FUNCTION UpdateProgress_Callback(llCancel) lnCounter = VAL( Session.GetSessionVar("Progress_Counter") ) LOCAL loArgs as ProgressEventArgs loArgs = CREATEOBJECT("ProgressEventArgs") *** Parameters come back as literal strings only *** so we have to parse 'true' IF llCancel loArgs.Cancelled = .T. loArgs.Percent = lnCounter RETURN loArgs ENDIF *** Completed IF lnCounter >= 100 loArgs.Completed = .T. loArgs.Percent = 100 RETURN loArgs ENDIF loArgs.Percent = lnCounter RETURN loArgs ************************************************************************************************************ FUNCTION ProcessComplete_Callback() RETURN .T. ENDFUNC ENDDEFINE
Thank you very much