Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Modal progress window

$
0
0
Re: Modal progress window
Web Connection 5.0
Re: Modal progress window
04/19/2012
10:05:04 AM
3HE0LM7SV Show this entire thread in new window
Gratar Image based on email address
From:
Marty Cantwell
To:
Attachments:
None
Where is the following code?

********************** 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() *** Create a counter we can increment and store in Session Session.SetSessionVar("Simulate_Counter","0") *** The ID is not used here, but usually you would *** 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") *** 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 *** HERE YOU WOULD NORMALLY DO YOUR CHECKS FOR ASYNCHRONOUS *** 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


Marty



Viewing all articles
Browse latest Browse all 10393

Trending Articles