Link to home
Create AccountLog in
Avatar of rrattie
rrattieFlag for United States of America

asked on

Bind Failed: element not found XXXXXX (CF 9.0.1)

I have multiple Bind Failed errors.   Specifically "Bind Failed, element not found: classes"
When I use cfdebug added to the URL I see:

info:widget: Creating window: cw2

error:bind: Bind failed, element not found: classes
Also, at least one cfwindow will spawn when the page loads.

These errors relate to multiple cfgrids inside of multple cflayout 'tabs' all with javascript for calling a cfwindow when a row is clicked on.

I'm hoping someone can see what I'm missing in all of this.



Here is my code for the cfwindow that I have in the page header:
<!--- Training page modal window  BEGIN--->
<cfif isDefined('URL.page') AND URL.page EQ '4'>
<cfajaximport tags="CFWINDOW, CFGRID, CFFORM">

<cfwindow  name="cw2" bodyStyle="background-color: white;" destroyOnClose="false" title="Class Detail"  refreshonshow="true"  modal="false" center="true"  initshow="false" width="650" height="350"
 source="training/classes/classInfo.cfm?id={f2:classes.ID@click}"/>
 </cfif>
<!--- Training page modal window END--->

Open in new window


Here is the code for the page:
<cfquery name="getMyClasses" datasource="this.DSN">
SELECT *
FROM dbo.Contacts
WHERE PIN = '#SESSION.UserID#'
</cfquery>

<cfquery name="checkUserTraining" datasource="this.DSN">
SELECT *
FROM UserTraining
WHERE ContactID = '#getMyClasses.ID#'
AND completed <> 'yes'
</cfquery>
<cfset SESSION.empID = '#getMyClasses.ID#'>

<cfparam name="current_date" default="#DateFormat(Now(), 'MM/DD/YYYY')#">

<div style="text-align:left; padding: 10px;">

<span style="font-weight:bold;">Employee Profile</span>
<ul>
  <li style="list-style:none;"><strong>Name:</strong>&nbsp;<strong><cfoutput>#getMyClasses.Full_Name#</cfoutput></strong></li>
  <li style="list-style:none;"><strong>Dept:</strong> &nbsp;<cfoutput>#getMyClasses.Branch#</cfoutput></li>
 
  <li style="list-style:none;">Title: &nbsp;<cfoutput>#getMyClasses.Job_Title#</cfoutput></li>
  <li style="list-style:none;">Location:&nbsp; <cfoutput>#getMyClasses.BLDG#</cfoutput></li>
  
 </ul>
</div>

<div style="text-align:left; width: 700px; padding-left:8px;">
    <cflayout type="tab" tabHeight="450" name="myclasses"  tabStrip="false" >
      <cflayoutarea title="All & Non-Supervisors" overflow="visible" source="training/classes/all_nonsupervisor.cfm" refreshOnActivate="true"  />
         
      
        <cflayoutarea title="Job Series Specific" overflow="visible" source="training/classes/all_jobseries.cfm" refreshOnActivate="true"  />

      <cflayoutarea title="Hourly Requirement Based" overflow="visible" source="training/classes/all_hourly.cfm" refreshOnActivate="true"  />
        
      <cfif isDefined('getMyClasses.job_series') AND getMyClasses.job_series EQ '12' OR getMyClasses.job_series EQ '13' OR getMyClasses.job_series EQ '14'>
        <cflayoutarea title="Intern" overflow="visible"  source="training/classes/all_intern.cfm" refreshOnActivate="true"  />
         </cfif>
     
</cflayout>
</div>

Open in new window


Here is the code for one of the cfgrids (all the grids are essentially the same, just pulling slightly different data):

<cfquery name="getMyClasses" datasource="this.dsn">
SELECT *
FROM dbo.Contacts
WHERE PIN = '#SESSION.UserID#'
</cfquery>




<script type="text/javascript">
function ClassDetailWindow(empid2) {
      ColdFusion.Window.show('cw2');
}
</script>
<!--- Create cfform, cgrid, cfinput --->
<!--- Use this a springboard to detect selection in grid, and execute Javascript function --->
<cfform name="f2" id="f2" format="html" style="padding-left:3px; padding-top:4px;">
<cfinput type="hidden" id="class_filter" name="class_filter" value="#trim(getMyClasses.ID)#">
     <cfgrid name="classes"
            format="html"
            striperows="yes"
             pagesize="10"
             preservepageonsort="true"
            bind="cfc:classes.allclasses({cfgridpage},
                                        {cfgridpagesize},
                                        {cfgridsortcolumn},
                                        {cfgridsortdirection},
                                        {class_filter@none}
                                        )"
           
            autoWidth="yes" collapsible="false"  title="Mandatory" colheaderbold="yes"  selectcolor="##D5EDB3" selectonload="false" >
        <cfgridcolumn name="ID" display="no"/>
        <cfgridcolumn name="course_name" header="Course" width="220"  />
        <cfgridcolumn name="description" header="Description" width="300" />
        <cfgridcolumn name="date" mask="m/d/y" header="Due Date" width="170"  />
    </cfgrid>
    <cfinput type="hidden" name="t2" bindonload="false" bind="javascript:ClassDetailWindow({f2:classes.ID@click})"/>
</cfform>

Open in new window

Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

Keep the statement out of <cfif>

<cfajaximport tags="CFWINDOW, CFGRID, CFFORM">

<cfif isDefined('URL.page') AND URL.page EQ '4'>
<cfwindow  name="cw2" bodyStyle="background-color: white;" destroyOnClose="false" title="Class Detail"  refreshonshow="true"  modal="false" center="true"  initshow="false" width="650" height="350"
 source="training/classes/classInfo.cfm?id={f2:classes.ID@click}"/>
 </cfif>
ASKER CERTIFIED SOLUTION
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account