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

bind: Bind failed, element not found

Guest
Dec 10, 2013 Dec 10, 2013

Copy link to clipboard

Copied

Hi,

i've test a simple search with cfgrid but don't know why when i dump the arguments from my cfc and it shows null instead of empty string.  

To testing, i added cfdebug at the end and see some error:

Element not found: ANo

'gridRender' is undefined.  

Please look at my code below and let me know what did i have wrong.  -Thanks

<!---form.cfm--->

<cfform action="process.cfm" method="post">
<cfinput type="text" name="ANo" id="ANo" value="">
<input class="button" type="submit" name="submit" value="Search" />
</cfform>


<!---process.cfm--->

<cfparam name="variables.row_per_page_default" default="15">
<cfparam name="variables.row_per_page_list" default="15,30,50,75,100">
<cfparam name="form.ANo" default="" />


<cfform name="gridform" >
    <cfgrid
       name="grdAresults"
       format="HTML"
       title="Search Result"
       collapsible="false"
    selectMode=" Single"
    pagesize="15"
    bindOnLoad="true" 
      stripeRowColor ="silver"
    stripeRows="yes"  width="900"
    bind="cfc:cfc.searchA.SearchA({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},
    {ANo})"
    >
  
         <cfgridcolumn dataalign="center" width="100" name="aNo_var" header="A Number" href="index.cfm?action=editCR"  hrefkey="id" target="_blank" />
  
  
    </cfgrid>
</cfform>  

    <cfset ajaxOnLoad("gridRender")>
   
   
    <!---cfc--->
    <cfcomponent displayname="search" output="no" hint="search a number">
     <cffunction name="SearchA" returntype="struct" access="remote">
        <cfargument name="page" required="true" />
        <cfargument name="pageSize" required="true" />
        <cfargument name="gridsortcolumn" required="true" />
        <cfargument name="gridsortdirection" required="true" />
   
       <cfargument name="ANo" required="yes" type="any" />
        <cfdump var="#arguments#"><cfabort>
       
        <cfquery name="qSearchA" datasource="#dsn#">
          select * from mytblb
          where  0=0
        <cfif arguments.ANo neq "">
          ANo_var = <cfqueryparam value="#arguments.ANo#" cfsqltype="cf_sql_varchar" />
        </cfif>
    </cfquery>
       
        <cfreturn queryconvertforgrid(qSearchA, page, pagesize)>
        </cfquery>
       
    </cfcomponent>

i don't see html from cfgrid format, all i see is xml, applet, flash.  I mannulay entery HTML in,  do you know why is HTML is not on the list?

Views

1.7K

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
Explorer ,
Dec 10, 2013 Dec 10, 2013

Copy link to clipboard

Copied

I assume you want to filter by the Ano value?

Try

{gridform:ANo}

But a better way would be

Javascript function

var ANo_value = "";

function get_ANo(){

     ANo_value = ColdFusion.getElementValue(ANo);

     return ANo_value

}

cfgrid

bind="cfc:cfc.searchA.SearchA({cfgridpage},{cfgridpagesize},{cfgridso rtcolumn},{cfgridsortdirection},

{get_ANo})"

regards

Ken

Votes

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
Guest
Dec 11, 2013 Dec 11, 2013

Copy link to clipboard

Copied

thank you

Votes

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
Explorer ,
Dec 11, 2013 Dec 11, 2013

Copy link to clipboard

Copied

I forgot to include the following for the javascript version.

On the form field

<cfinput type="text" name="ANo" id="ANo" value="">

Include an onKeyUp event

<cfinput type="text" name="ANo" id="ANo" value="" onKeyUp="get_ANo()">

This will then filter the grid with each character entered.

Ken

Votes

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
Guest
Dec 11, 2013 Dec 11, 2013

Copy link to clipboard

Copied

did not work, error: Element not found: get_ANo

Votes

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
Explorer ,
Dec 11, 2013 Dec 11, 2013

Copy link to clipboard

Copied

LATEST

Sorry, my mistake.  I assume your using the javascript version?

Then

bind="cfc:cfc.searchA.SearchA({cfgridpage},{cfgridpagesize},{cfgridso rtcolumn},{cfgridsortdirection},

get_ANo())"

If your trying to bind through the cf form field then I don't know as I don't do it that way.

Ken

Votes

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
Resources
Documentation