Skip to main content
Inspiring
June 12, 2013
Question

cfchart and progress bar

  • June 12, 2013
  • 0 replies
  • 405 views

Hi I have a page with charts. A data download page displays records to preview when they click the chart. I have taken a CFprogress bar tutorial at lynda.com and  yet still have no idea how to make this work. For a few charts (that take a while to get to the download page) I need a to display a page with a progess bar and then the data detail page.

I have a .cfc and progress. cfm. How do i hook this up?? Any assistance would be totally freakiing awesome!

jim

<!---- progress bar page--->

<html>
<head>

</head>
<body><cfinvoke component="cfc/progessCheck" method="getStatus" returnvariable="retVal">
<cfprogressbar name="testbar" duration="10000" />

</body>
</html>

-------------------------------------------------------------------------------------------------------------------------------------

<!--- the cfc--->

<cfcomponent>
<cffunction name="getStatus" access="remote" returntype="struct">
  <cfset LOCAL.retVal = {} />

  <cfif NOT StructKeyExists(Session, "Progress")>
   <cfset Session.Progress = 0 />
  </cfif>   

  <cfset Session.Progress += .1 />
  <cfif Session.Progress GT 1>
   <cfset Session.Progress = 1 />
  </cfif>

  <cfset LOCAL.retVal.Status = Session.Progress />

  <cfif LOCAL.retVal.Status LTE .2>
   <cfset LOCAL.retVal.message = "Initializing " />
  </cfif>
  <cfif LOCAL.retVal.Status GTE .25>
   <cfset LOCAL.retVal.message = "Loading " />
  </cfif>
  <cfif LOCAL.retVal.Status GTE .5>
   <cfset LOCAL.retVal.message = "Loading . . ." />
  </cfif>
  <cfif LOCAL.retVal.Status GTE .75>
   <cfset LOCAL.retVal.message = "Almost Done%" />
  </cfif>
  <cfif LOCAL.retVal.Status EQ 1>
   <cfset LOCAL.retVal.message = "Finished" />
   <cfset StructDelete(Session, "Progress") />
  </cfif>

  <cfreturn LOCAL.retVal />
</cffunction>

</cfcomponent>

    This topic has been closed for replies.