1 Reply Latest reply on Aug 28, 2008 1:15 PM by MMFranklin

    Bind in CFGRID with a CFC, HELP!

    code_hound11
      Hey everybody, I am new to the world of CFC's and have run into a roadblock with trying to utilize CFGRID. I want to do a BIND expression and I thought I had the correct syntax but no avail. Im passing a Form variable (search_mfg) to the results page. Ill post my CFC and results page below... any help is really appriciated... thank you!

      CFC Page
      ++++++++++++++++++++++

      <!--- Search Manufacturer Component --->
      <CFCOMPONENT HINT="Manufacturer Detail" >

      <!--- List users method --->
      <CFFUNCTION NAME="Search_Mfg" access="remote" returntype="struct">
      <cfargument name="search_mfg" required="true" />
      <cfargument name="page" required="true" />
      <cfargument name="pageSize" required="true" />
      <cfargument name="gridsortcolumn" required="true" />
      <cfargument name="gridsortdirection" required="true" />

      <cfif arguments.gridsortcolumn eq "">
      <cfset arguments.gridsortcolumn = "ProductTitle" />
      <cfset arguments.gridsortdirection = "asc" />
      </cfif>

      <!--- Get manufacturer detail --->


      <cfquery datasource="marinepowerservice" name="qry_getMfg">
      Select *
      From Products_kel
      WHERE ManufacturerID = '#search_mfg#'
      <cfif ARGUMENTS.gridsortcolumn NEQ "" and ARGUMENTS.gridsortdir NEQ "">
      ORDER BY #ARGUMENTS.gridsortcolumn# #ARGUMENTS.gridsortdir#
      <cfelse>
      ORDER BY ProductItemNbr
      </cfif>

      </cfquery>

      <CFRETURN queryconvertforgrid(qry_getMfg, page, pagesize) />

      </CFFUNCTION>

      </CFCOMPONENT>




      Results Page
      ++++++++++++++++++++++++++

      <cfform name="test">
      <cfgrid
      name="result"
      format="html"
      width="702"
      bind="cfc:productsearch.Search_Mfg({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgr idsortdirection},{form:search_mfg})"
      colheaderbold="yes"
      pagesize="5"
      highlighthref="yes"
      pictureBar = "Yes"
      >

      <cfgridcolumn name="PRODUCTID" header="ID" width="50">
      <cfgridcolumn name="Manufacturer" header="Mfg">
      <cfgridcolumn name="titlelink" header="Title" width="250">
      <cfgridcolumn name="ProductItemNbr" header="Item Number">
      <cfgridcolumn name="DateEntered" header="Posted">

      </cfgrid>
      </cfform>