component extends="Wheels" {
function init() {provides("json"); // Necessary to allow calling to ?format=json from the remote call to return JSON data
}
remote function progress() {
str = StructNew();str.message = "Saving";if (!IsDefined("session.status")) {session.status = 0.1;sleep(200);
}else if (session.status < 0.9) {session.status = session.status + .1;sleep(200);}else {str.message = "Done!";session.status = 1;}
str.status = session.status;return(renderWith(data=str, layout=false));
}
}
<script>
startBar = function() {ColdFusion.ProgressBar.start("test");
}
</script>
<cfif IsDefined("Session.STATUS")>
<cfscript>
StructDelete(Session,"STATUS");
</cfscript>
</cfif>
<cfprogressbar name="test" interval="1000"
bind="url:/progress/progress/?format=json"
autodisplay="true">
<a href="javascript:startBar()"> Start! </a>
--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cfwheels/-/5fmDginR5psJ.
To post to this group, send email to cfwh...@googlegroups.com.
To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/cfwheels/-/yLVoN7ZuXc8J.