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/18/2012
06:50:33 AM
3HD0EO32N Show this entire thread in new window
Gratar Image based on email address
From:
Marty Cantwell
To:
Attachments:
None
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() *** 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



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




Viewing all articles
Browse latest Browse all 10393

Trending Articles