• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfchart and progress bar

Explorer ,
Jun 12, 2013 Jun 12, 2013

Copy link to clipboard

Copied

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>

Views

367

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources
Documentation