Loading ...
Sorry, an error occurred while loading the content.

Call Dynamic Do Query in Display Page

Expand Messages
  • kinggassi
    I m trying to call a dynamic do from a display fuse (dspUsersAddEdit.cfm) to populate a select by looping over the query results. If I use this code:
    Message 1 of 2 , Dec 2, 2008
    • 0 Attachment
      I'm trying to call a dynamic do from a display fuse
      (dspUsersAddEdit.cfm) to populate a select by looping over the query
      results.

      If I use this code:

      <cfscript>
      myFusebox.do("mAdmin.qryGetRoles");
      </cfscript>

      It runs the query however my loop doesn't recognize the query and I get
      this error:

      Attribute validation error for tag cfloop.
      The value of the attribute query, which is currently qryGetRoles, is
      invalid.

      I know I could add it to the fuseaction and it would run fine, but I
      might need to call a query directly on a page to loop over certain
      results.
    • Adam Haskell
      you ll want to use the event object to pass the query around. In your mAdmin.qryGetRoles then in your dsp:
      Message 2 of 2 , Dec 4, 2008
      • 0 Attachment
        you'll want to use the event object to pass the query around.

        In your mAdmin.qryGetRoles

        <cfset event.setValue("qryGetRoles", qryGetRoles) />



        then in your dsp:

        <cfset qryGetRoles = event.getValue("qryGetRoles") />


        Variables are protected in the CFC they don't leek out so your query will never make it to your dsp page unless you use the event object. Make sense?


        Adam


        On Tue, Dec 2, 2008 at 5:36 PM, kinggassi <james@...> wrote:

        I'm trying to call a dynamic do from a display fuse
        (dspUsersAddEdit.cfm) to populate a select by looping over the query
        results.

        If I use this code:

        <cfscript>
        myFusebox.do("mAdmin.qryGetRoles");
        </cfscript>

        It runs the query however my loop doesn't recognize the query and I get
        this error:

        Attribute validation error for tag cfloop.
        The value of the attribute query, which is currently qryGetRoles, is
        invalid.

        I know I could add it to the fuseaction and it would run fine, but I
        might need to call a query directly on a page to loop over certain
        results.


      Your message has been successfully submitted and would be delivered to recipients shortly.