0 Replies Latest reply on Jun 12, 2013 9:44 AM by rockhiker

    cfchart and progress bar

    rockhiker Level 1

      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>