Link to home
Start Free TrialLog in
Avatar of mchristopher
mchristopherFlag for United States of America

asked on

ColdFusion bind fails

The following bind fails:
              <!--- values for PE category - Outyears Budget Information --->
                    <cfselect name="pecat_#i#" style="width:80px;" >
                              <option value=""></option>                  
                              <cfloop list= "#ValueList(qryCPecat.pecat)#" index="j" >
                                   <option value="#j#" <cfif j eq qryOBudget.pecat>selected</cfif>>#j#</option>
                              </cfloop>
                          </cfselect>  
 <!--- Outyears Budget Information --->    
                    <cfset myqryGetPECode = manpowerObj.funcGetPECode(pecat = qryOBudget.pecat) >
               
                <!--- QUESTION: how to bind to this withing the outer loop <cfloop from="#session.fiscal + 1#" to="#session.fiscal + 4#" index="i"> --->
                         <cfselect name="peccode_#i#" value="code" display="code"
                selected="#qryOBudget.peccode#" queryPosition="below" style="width:60px;"
                bind="myqryGetPECode({pecat_#session.fiscal#})"
                         bindonload="yes">
                      <option value=""></option>
                </cfselect>
Avatar of mchristopher
mchristopher
Flag of United States of America image

ASKER

Yet the following script succeeds:
   <cfselect name="pecat_#session.fiscal#" id="pecat_#session.fiscal#" required="yes"
         validateat="onSubmit" message="Please select a DMA Function Code">  
            <option value=""></option>                  
            <cfloop list= "#ValueList(qryCPecat.pecat)#" index="i" >
                 <option value="#i#" <cfif i eq qryCBudget.pecat>selected</cfif>>#i#</option>                
            </cfloop>
        </cfselect>
       <cfselect name="peccode_#session.fiscal#" value="code" display="description"
             selected="#qryCBudget.peccode#"
             bind="cfc:manpower_test.qryPECDescription({pecat_#session.fiscal#})" bindonload="yes"  
             queryPosition= "below" validateat="onSubmit" required="yes"  message="Please select a PEC Code">
                  <option value=""></option>  
         </cfselect>
Avatar of _agx_
Fails how?  Can you post any CF error messages / messages from your Ajax logs.
error:bind: Bind failed for select box peccode_2016, bind value is not a 2D array or valid serialized query

error:bind: Bind failed for select box peccode_2015, bind value is not a 2D array or valid serialized query

error:bind: Bind failed for select box peccode_2014, bind value is not a 2D array or valid serialized query

error:bind: Bind failed for select box peccode_2013, bind value is not a 2D array or valid serialized query
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
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
Thank you very much. I will test this at 8 AM EST tomorrow (no VPN login available this evening) and credit by time stamp and effectiveness.
This was very helpful, thanks. It took me a few tries to get it working at the loop within an outer loop.
Thanks again.