Link to home
Start Free TrialLog in
Avatar of lantervj
lantervjFlag for United States of America

asked on

cfdiv erratic bind

When I first added the cfdiv (to display a grid-like table) it worked fine passing on variable in the URL scope.  I added a second variable and it worked fine.  I added a thrid variable and got an error saying the variable was not defined in the URL scope. I removed the third variable and got the error on the second variable. I remove the second variable and it worked again. I added the second variable back in and it worked.  I added the third variable back in and it worked.  I added a fourthe variable and it worked.  I added a fifth variable and it failed and continued to fail as I removed one variable at a time.

This appears to be a little know bug but there's not much info on it.
<tr>
<td valign="top" colspan="2">
<cflayout type="tab" name="Modify Job" style="width:1050px">
<cflayoutarea title="Modify Job">
<cfform action="" method="POST">
<cfinclude template="divSearchParms.cfm" />
<cfdiv bind="url:dspPagesDiv.cfm?selectJobID={selectJobID}&selectCompany_Name={selectCompany_Name}&selectJobTitle={selectJobTitle}&selectMarketer={selectMarketer}&board_type={board_type}" id="pageDiv" />

The included divSearchParms.cfm--------------------------------------
<div style="background-color:ebebeb; align:center;">
<table>
<tr><td><table  style="font-size:7;">
<tr><td align="center">Job ID:</td>
</tr><tr><td><cfinput type="text" name="selectJobID" size="8"></td></tr></table></td>	
<td><table style="font-size:7;">
<tr><td align="center">Company Name:</td></tr>
<tr><td><cfinput type="text" name="selectCompany_Name"></td></tr></table></td>
<td><table style="font-size:7;"><tr>				<td><strong>Job Title:</strong></td></tr>
<tr><td><cfinput type="text" name="selectjobTitle" /></td></tr>
</table></td>


The div--------------------------------------------------------
<cfinvoke component="cfc.basic" method="getPages" returnvariable="qPages">
<cfinvokeargument name="board_type" value="#url.board_type#">
<cfinvokeargument name="selectJobID" value="#url.selectJobID#">
<cfinvokeargument name="selectCompanyName" value="#url.selectCompany_Name#">
<cfinvokeargument name="selectJobTitle" value="#url.selectJobTitle#">
<cfinvokeargument name="selectMarketer" value="#url.selectMarketer#">
<cfinvokeargument name="sort_order" value="#attributes.sort_order#">
<cfinvokeargument name="sort_col" value="#attributes.sort_col#">
<cfinvokeargument name="start" value="#variables.start#">
<cfinvokeargument name="stop" value="#variables.stop#">
</cfinvoke>
<cfinvoke component="cfc.basic" method="getPagesCount" returnvariable="qPageCount">
<cfinvokeargument name="board_type" value="#url.board_type#">
<cfinvokeargument name="selectJobID" value="#url.selectJobID#">
<cfinvokeargument name="selectCompanyName" value="#url.selectCompany_Name#">
<cfinvokeargument name="selectJobTitle" value="#url.selectJobTitle#">
<cfinvokeargument name="selectMarketer" value="#url.selectMarketer#">
<cfinvokeargument name="sort_order" value="#attributes.sort_order#">
<cfinvokeargument name="sort_col" value="#attributes.sort_col#">
<cfinvokeargument name="start" value="#variables.start#">
<cfinvokeargument name="stop" value="#variables.stop#">
</cfinvoke>

<cfoutput>
<table id="articles" style="font-size:14;"><tr>
<th width="30px" style="text-align:center"><a href="" onClick="javascript: ColdFusion.navigate('dspPagesDiv.cfm?job_type=#attributes.board_type#&sort_col=id&sort_order=#attributes.sort_order#','pageDiv'); return false;">JobID</a></th>
<th ><a href="" onClick="javascript: ColdFusion.navigate('dspPagesDiv.cfm?job_type=#attributes.board_type#&sort_col=approvedbydate&sort_order=#attributes.sort_order#','pageDiv'); return false;">LiveDate</a></th>
<th ><a href="" onClick="javascript: ColdFusion.navigate('dspPagesDiv.cfm?job_type=#attributes.board_type#&sort_col=old_tt_id&sort_order=#attributes.sort_order#','pageDiv'); return false;">Old TT ID</a></th>
<th ><a href=""

Open in new window

Avatar of gdemaria
gdemaria
Flag of United States of America image


Is the section you've called "The Div" supposed to be the "dspPagesDiv.cfm" file ?

At the beginning of that file you should place a cfparam tag for each url variable that you might pass

<cfparam name="url.board_type" default="">

That way if you don't pass it, it will not error
Avatar of lantervj

ASKER

I added a dump, after doing a cfparam of all the passed variables, of the URL scope and the selectJobTitle is in there but I still get an error

<cfparam name="url.board_type" default="2" />
<cfparam name="url.selectJobID" default="" />
<cfparam name="url.selectCompanyName" default="" />
<cfparam name="url.selectJobTitle" default="" />
<cfparam name="url.selectMarketer" default="" />

<cfdump var="#url#"><cfabort>

<cfinvoke component="cfc.basic" method="getPages" returnvariable="qPages">
      <cfinvokeargument name="board_type" value="#url.board_type#">
      <cfinvokeargument name="selectJobID" value="#url.selectJobID#">
      <cfinvokeargument name="selectCompanyName" value="#url.selectCompany_Name#">
      <cfinvokeargument name="selectJobTitle" value="#url.selectJobTitle#">
      <cfinvokeargument name="selectMarketer" value="#url.selectMarketer#">
      <cfinvokeargument name="sort_order" value="#attributes.sort_order#">
      <cfinvokeargument name="sort_col" value="#attributes.sort_col#">
      <cfinvokeargument name="start" value="#variables.start#">
      <cfinvokeargument name="stop" value="#variables.stop#">
</cfinvoke>


struct
SELECTCOMPANYNAME       [empty string]
_cf_clientid                               C240440137357E786B00CC5B5A8F468D
_cf_containerId                       pageDiv
_cf_nocache                       true
_cf_nodebug                       true
_cf_rc                                       0
board_type                               Custom
selectCompany_Name       [empty string]
selectJobID                               [empty string]
selectJobTitle                       [empty string]
selectMarketer                       0
You also have attribute variables that may be undefined?

I'd like to pin down whether the error is in the code you are showing or the cfc

Let's comment out the cfc call and just cfoutput it (I intentionally removed the first < from each tag so it would just display to the screen).

Please show the error message if it happens..

<cfparam name="url.board_type" default="2" />
<cfparam name="url.selectJobID" default="" />
<cfparam name="url.selectCompanyName" default="" />
<cfparam name="url.selectJobTitle" default="" />
<cfparam name="url.selectMarketer" default="" />

<cfdump var="#url#"><cfabort>

<cfoutput>
cfinvoke component="cfc.basic" method="getPages" returnvariable="qPages">
      cfinvokeargument name="board_type" value="#url.board_type#">
      cfinvokeargument name="selectJobID" value="#url.selectJobID#">
      cfinvokeargument name="selectCompanyName" value="#url.selectCompany_Name#">
      cfinvokeargument name="selectJobTitle" value="#url.selectJobTitle#">
      cfinvokeargument name="selectMarketer" value="#url.selectMarketer#">
      cfinvokeargument name="sort_order" value="#attributes.sort_order#">
      cfinvokeargument name="sort_col" value="#attributes.sort_col#">
      cfinvokeargument name="start" value="#variables.start#">
      cfinvokeargument name="stop" value="#variables.stop#">
/cfinvoke>
</cfoutput>

<!--------
<cfinvoke component="cfc.basic" method="getPages" returnvariable="qPages">
      <cfinvokeargument name="board_type" value="#url.board_type#">
      <cfinvokeargument name="selectJobID" value="#url.selectJobID#">
      <cfinvokeargument name="selectCompanyName" value="#url.selectCompany_Name#">
      <cfinvokeargument name="selectJobTitle" value="#url.selectJobTitle#">
      <cfinvokeargument name="selectMarketer" value="#url.selectMarketer#">
      <cfinvokeargument name="sort_order" value="#attributes.sort_order#">
      <cfinvokeargument name="sort_col" value="#attributes.sort_col#">
      <cfinvokeargument name="start" value="#variables.start#">
      <cfinvokeargument name="stop" value="#variables.stop#">
</cfinvoke>
------->

Open in new window

cfinvoke component="cfc.basic" method="getPages" returnvariable="qPages">
 cfinvokeargument name="board_type" value="Custom">  
cfinvokeargument name="selectJobID" value="">  
cfinvokeargument name="selectCompanyName" value="">  
cfinvokeargument name="selectJobTitle" value="">  
cfinvokeargument name="selectMarketer" value="0">  
cfinvokeargument name="sort_order" value="Asc">  
cfinvokeargument name="sort_col" value="">  
cfinvokeargument name="start" value="0">  
cfinvokeargument name="stop" value="20">
 /cfinvoke>
This popup error is not recorded in the cf log file
cfdiverror.bmp
BTW;  the page does return data. It's just that the bind failed.  In fact, the original post from me meant I was getting an error page returned from the server.  This new error is just an AJAX popup error with very little to go on.  
That error seems to be associated with this tag...

<cfdiv bind="url:dspPagesDiv.cfm?selectJobID={selectJobID}&selectCompany_Name={selectCompany_Name}&selectJobTitle={selectJobTitle}&selectMarketer={selectMarketer}&board_type={board_type}" id="pageDiv" />


selectJobTitle={selectJobTitle} <!===== this value

what is that pointing to?

Do you have a CFINPUT tag named "selectJobTitle" ?
ASKER CERTIFIED SOLUTION
Avatar of gdemaria
gdemaria
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is part of the divSearchParms.cfm that contains the cfinputs;

<div style="background-color:ebebeb; align:center;">
<table>

  <tr>
            <td>
                  <table  style="font-size:7;">
                        <tr>
                      <td align="center">Job ID:</td>
                      </tr>
                      <tr>
                      <td><cfinput type="text" name="selectJobID" size="8"></td>
                        </tr>
                  </table>
            </td>
            
            <td>
                  <table style="font-size:7;">
                        <tr>
                      <td align="center">Company Name:</td>
                      </tr>
                      <tr>
                      <td><cfinput type="text" name="selectCompany_Name"></td>
                        </tr>
                  </table>
            </td>
            <td>
                        <table style="font-size:7;">
                              <tr>
                                    <td><strong>Job Title:</strong></td>
                              </tr>
                              <tr>
                            <td><cfinput type="text" name="selectjobTitle" />
                                    </td>
                              </tr>
                        </table>                  
                  </td>
            <td>
                  <table style="font-size:7;">
                        <tr>
                              <td align="center">Marketer:</td>
                              </tr>
                              <tr>
                              <td><cfselect name="selectMarketer" size="1">
                                                <option value="0" selected>
                                                      All
                                                </option>
                                                <cfoutput>
                                                <cfloop query="getAdmins">
                                                      <option value="#getAdmins.adminid#">
                                                            #getAdmins.name#
                                                      </option>
                                                </cfloop>
                                                </cfoutput>
                                          </cfselect></td>
                        </tr>
                  </table>
            </td>
      
URL variables from the debug output;
URL Parameters:
CFID=1001613
CFTOKEN=80089461
board_type=Custom    <----------  the only url param that was passed for the bind
cfdebug=1
comingfrom=modify
fa=home
From the debug window;
info:widget: Selected tab, id: cf_layoutarea1297974020175 in tab container, id: Modify Job

info:http: HTTP GET dspPagesDiv.cfm?selectJobID=&selectCompany_Name=&selectJobTitle=&selectMarketer=0&board_type=Custom&_cf_containerId=pageDiv&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=C240440137357E786B00CC5B5A8F468D&_cf_rc=0

info:http: Replacing markup for element: pageDiv from URL dspPagesDiv.cfm?selectJobID=&selectCompany_Name=&selectJobTitle=&selectMarketer=0&board_type=Custom with params _cf_containerId=pageDiv

error:bind: Element not found: selectJobTitle

error:bind: Bind failed, element not found: selectJobTitle

info:widget: Selected tab, id: cf_layoutarea1297974020173 in tab container, id: New Job

info:widget: Selected tab, id: cf_layoutarea1297974020169 in tab container, id: companySelect

info:widget: Firing selection change event for grid id: compGrid

info:widget: Created grid, id: compGrid

info:LogReader: LogReader initialized

info:global: Logger initialized
I wish I knew exactly what fixed the problem, but it works now.  One BIG problem was the spelling of the element name selectJobTitle.  I use a lower case "j" and that caused one of the 2 errors that the element could not be found.  But, after correcting the spelling I still got one error that the same element could not be found.  I renamed the passing variable name to xselectJobTitle and the error reflected that name so the error was directly related to the CFDIV statement.  I noticed that I had the element board_type defined twice in the bind string.  After fixing that and removing all use of cflayout,  the error went away.  Making one change at a time is the best debuggin technique, but we all fall prey to the frustration.  Anyway,  thanks for hanging in with me.