Bind CfSelect

So I have a cfgrid that is based on a query, in that query
there is a FK for stateID, I can get all my other test fields to
bind to the selected item, everything but the cfselect for the
state, the state cfselect is populated by a different query. I have
tried to do a bind and selected. but no joy. ANy help would be very
much appreciated. I have attached the code.

While I would not call this a solution, it is fixed - for
now.
I noticed that in the other areas of my application that also
use this cfselect bind feature they had also stopped functioning,
even though the CFCs could be successfully invoked and data
returned and all looked ok. While I would love to find out what
exactly that "Internal Server Error" message is, I simply copied
the /CFIDE folder from one of my boxes that works to the troubled
server, restarted and it now works. I thought if all of the
cfselect binds were failing then maybe it was a supporting .js file
that possibly got corrupted or deleted.
Anyway, back in business. Like I said, not a true fix, but
we're moving forward again.
Rich

Similar Messages

  • Multiple CFFORMs in a page w/ binding CFSELECTS

    Howdy all.
    I have a page that has two CFFORMs, each uniquely named (form1 & form2 for example).
    Each form is essentially the same - each one has a cfselect with States pulled from a common query and also has a bound cfselect that shows the Area Codes for that chosen state. Both cfselect elements are called "State" and "AreaCode" respectively. I do not wish to change the name of the cfselect elements.
    {cfform name="form1"}
         {cfselect name="State" bind="cfc:path.to.cfc.getStates()" bindonload="yes" }
         {cfselect name="AreaCode" bind="cfc:path.to.cfc.getAreaCodes(state={form1:State})" bindonload="yes" }
    { /cfform }
    {cfform name="form2"}
         {cfselect name="State" bind="cfc:path.to.cfc.getStates()" bindonload="yes" }
         {cfselect name="AreaCode" bind="cfc:path.to.cfc.getAreaCodes(state={form2:State})" bindonload="yes" }
    { /cfform }
    The problem is, if I switch the state select in form2, *form1*'s AreaCode gets the bound response instead of form2.
    Is there a way to expressly tell CF to "stay within its own form" for the binding?
    Thanks in advance,
    Andrew

    I spoke too soon. It works for the latest FireFox, but not with IE8.
    I've modified the form slightly to:
    {cfform name="form1"}
         {cfselect id="State" name="State" bind="cfc:path.to.cfc.getStates()" bindonload="yes" }
         {cfselect id="AreaCode" name="AreaCode" bind="cfc:path.to.cfc.getAreaCodes(state={form1:State})" bindonload="yes" }
    { /cfform }
    {cfform name="form2"}
         {cfselect id="State2" name="State" bind="cfc:path.to.cfc.getStates()" bindonload="yes" }
         {cfselect id="AreaCode2" name="AreaCode" bind="cfc:path.to.cfc.getAreaCodes(state={form2:State2})" bindonload="yes" }
    { /cfform }
    I fired up the AJAX Logger on IE8 to try to see what's going on.
    If I switch the state on form1, the AreaCode field in form1 is NOT populated correctly, and the logger seems to indicate that it's pushing the values to the second form.
    If I switch the state on form2, AreaCode2 IS populated correctly.
    Darn you, Internet Explorer!
    Any further suggestions would be most welcome. Thanks in advance.
    -Andrew

  • Problem with bind in a CFSELECT

    I am trying to get a CFSELECT to populate using bind.  If I use:
    <CFSELECT bind="http://www.myDomain.com/CFC/file.cfc?method=getSizes({materialColor})">
    </CFSELECT>
    my bind works... somewhat. 
    But if I use:
    <CFSELECT bind="cfc:myCFC.file.getSizes({materialColor})">
    </CFSELECT>
    I get:
    "The specified CFC myCFC.file could not be found.  The path to the CFC must be specified as a full path, or as a relative path from the current template, without the use of mappings."
    The Coldfusion exception log says the same.  myCFC is setup as a mapping to the D:/wwwroot/CFC directory in Coldfusion Administrator.  I've tried putting the .cfc file in the same directory as the .cfm that calls it but I get the same error.  It seems no matter where I put it and tell Coldfusion to look for it, unless I use http: I get that error. 
    I've tried using the cfdebug parameter on the page after enabling debugging in Administrator but it doesn't seem to do anything.
    I'm using Coldfusion 9 Developer with Apache 2.2.14 and PHP 5.2.11. 
    Thanks for the help.

    What you describe should work. I only have doubts about D:/wwwroot/CFC.
    I successfully tested with something like this:
    1) Component: c:\Coldfusion9\wwwroot\CFC\file.cfc
    2) In the mappings page Administrator
    Logical path: /myCFC
    Directory path: c:\Coldfusion9\wwwroot\CFC
    3) <CFSELECT bind="cfc:myCFC.file.getSizes({materialColor})"></CFSELECT

  • Bind in form works with cfinput, how to with cfselect and a href

    Hi all
    This code workks binding a cfinput in an HTML cfform:
    Name:<cfinput type="text" name="FIRSTNAME" label="Name" required="yes" width="150" bind="{UsersGrid.FIRSTNAME}" >
    However this href doesn't seem to bind correctly:
    <a  href="http://www.google.com/search?hl=en&output=search&sclient=psy-ab&q={UsersGrid.COMPANY}&btnK=" bind="{UsersGrid.COMPANY}">Google.com</a>
    This cfselect doesn't either:
    Department: <cfselect name="DEPARTMENT1" width="100" size="1" label="Department" required="yes" bind="UsersGrid.DEPARTMENT1">
    <option></option><cfoutput query="dNames"><option value="#DEPARTMENTIDS#">#DEPARTMENTNOM#</option></cfoutput>
    </cfselect> 
    How can I make them both work? Thank you

    Sure, Aaaron here it is, it uses the same database tables and datasource as in the other thread:
    <cfquery name="QNAMES" datasource="tester">
        select * from company, industries, division
    where company.SECTORS1 = industries.SECTORSIDS
    <cfif structKeyExists(url,"sectorid")>
    and industries.SECTORSIDS = #url.sectorid#</cfif>
    and division.DEPARTMENTIDS = company.DEPARTMENT1
    and company.WHEN = 2
    ORDER BY company</cfquery>
    <cfquery name="dNames" datasource="tester">
        select DEPARTMENTIDS, DEPARTMENTNOM
        from division
    order by DEPARTMENTNOM</cfquery>
    <CFQUERY name="industries" datasource="tester">
    SELECT * FROM industries
    </CFQUERY>
    <CFQUERY name="salesstep" datasource="tester">
    SELECT * FROM sales
    </CFQUERY>
    <CFQUERY name="xity" datasource="tester">
    SELECT * FROM ciudad
    </CFQUERY>
    <CFQUERY name="hols" datasource="tester">
    SELECT * FROM holidays
    </CFQUERY>
    <!--- UPDATE QUERY --->
    <cfif isDefined("FORM.UPDATEADDBTN")>
    <cfif FORM.ENTID GTE 1>
    <cfset isCOMPANYNull = iif(len(trim(FORM.COMPANY)) EQ 0, true, false)>
    <cfset isSECTORS1Null = iif(len(trim(FORM.SECTORS1)) EQ 0, true, false)>
    <cfset isRANKINGNull = iif(len(trim(FORM.RANKING)) EQ 0, true, false)>
    <cfset isPRICENull = iif(len(trim(FORM.PRICE)) EQ 0, true, false)>
    <cfset isDEPARTMENT1Null = iif(len(trim(FORM.DEPARTMENT1)) EQ 0, true, false)>
    <cfset isFIRSTNAMENull = iif(len(trim(FORM.FIRSTNAME)) EQ 0, true, false)>
    <cfset isPOSNull = iif(len(trim(FORM.POS)) EQ 0, true, false)>
    <cfset isPHONENull = iif(len(trim(FORM.PHONE)) EQ 0, true, false)>
    <cfset isEMAILNull = iif(len(trim(FORM.EMAIL)) EQ 0, true, false)>
    <cfset isMOBILENull = iif(len(trim(FORM.MOBILE)) EQ 0, true, false)>
    <cfset isADDRESSNull = iif(len(trim(FORM.ADDRESS)) EQ 0, true, false)>
    <cfset isCITYNull = iif(len(trim(FORM.CITY)) EQ 0, true, false)>
    <cfset isCOMMENTSNull = iif(len(trim(FORM.COMMENTS)) EQ 0, true, false)>
    <cfset MEETINGDATE = trim(FORM.ABUNDANCE)>
    <!--- DATECFM--->
    <cfset isMTGTNull = iif(len(trim(FORM.MTGT)) EQ 0, true, false)>
    <cfset isSTATE1Null = iif(len(trim(FORM.STATE1)) EQ 0, true, false)>
    <CFQUERY name="updatecompany" datasource="tester">
    update COMPANY
    SET COMPANY = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMPANY)#" null="#isCOMPANYNull#" />,
       SECTORS1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.SECTORS1)#" null="#isSECTORS1Null#" />,
       RANKING = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.RANKING)#" null="#isRANKINGNull#" />,
       PRICE = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.PRICE)#" null="#isPRICENull#" />,
       DEPARTMENT1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.DEPARTMENT1)#" null="#isDEPARTMENT1Null#" />,
       FIRSTNAME = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.FIRSTNAME)#" null="#isFIRSTNAMENull#" />,
       POS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.POS)#" null="#isPOSNull#" />,
       PHONE = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.PHONE)#" null="#isPHONENull#" />,
       EMAIL = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.EMAIL)#" null="#isEMAILNull#" />,
       MOBILE= <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MOBILE)#" null="#isMOBILENull#" />,
       ADDRESS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.ADDRESS)#" null="#isADDRESSNull#" />,
       CITY = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.CITY)#" null="#isCITYNull#" />,
       COMMENTS = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMMENTS)#" null="#isCOMMENTSNull#" />,
       ABUNDANCE = <cfqueryparam cfsqltype="cf_sql_timestamp" value="#MEETINGDATE#" />,
       MTGT = <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MTGT)#" null="#isMTGTNull#" />,
       STATE1 = <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.STATE1)#" null="#isSTATE1Null#" />
    WHERE ENTID = #FORM.ENTID#
    </CFQUERY>
    <CFLOCATION URL="testht.cfm?begin=1">
    <cfelse>
    <cfset isCOMPANYNull = iif(len(trim(FORM.COMPANY)) EQ 0, true, false)>
    <cfset isSECTORS1Null   = iif(len(trim(FORM.SECTORS1)) EQ 0, true, false)>
    <cfset isRANKINGNull = iif(len(trim(FORM.RANKING)) EQ 0, true, false)>
    <cfset isPRICENull = iif(len(trim(FORM.PRICE)) EQ 0, true, false)>
    <cfset isDEPARTMENT1Null = iif(len(trim(FORM.DEPARTMENT1)) EQ 0, true, false)>
    <cfset isFIRSTNAMENull = iif(len(trim(FORM.FIRSTNAME)) EQ 0, true, false)>
    <cfset isPOSNull = iif(len(trim(FORM.POS)) EQ 0, true, false)>
    <cfset isPHONENull = iif(len(trim(FORM.PHONE)) EQ 0, true, false)>
    <cfset isEMAILNull = iif(len(trim(FORM.EMAIL)) EQ 0, true, false)>
    <cfset isMOBILENull = iif(len(trim(FORM.MOBILE)) EQ 0, true, false)>
    <cfset isADDRESSNull = iif(len(trim(FORM.ADDRESS)) EQ 0, true, false)>
    <cfset isCITYNull = iif(len(trim(FORM.CITY)) EQ 0, true, false)>
    <cfset isCOMMENTSNull = iif(len(trim(FORM.COMMENTS)) EQ 0, true, false)>
    <cfset isMTGTNull = iif(len(trim(FORM.MTGT)) EQ 0, true, false)>
    <cfset isSTATE1Null = iif(len(trim(FORM.STATE1)) EQ 0, true, false)>
    <cfset MEETINGDATE = trim(FORM.ABUNDANCE)>
    <!--- DATECFM --->
    <!--- ADD COMPANY QUERY --->
    <CFQUERY name="addcompany" datasource="tester">
    INSERT INTO COMPANY(
    COMPANY,
    SECTORS1,
    RANKING,
    PRICE,
    DEPARTMENT1,
    FIRSTNAME,
    POS,
    PHONE,
    EMAIL,
    MOBILE,
    ADDRESS,
    CITY,
    COMMENTS,
    ABUNDANCE,
    MTGT,
    STATE1
    VALUES (
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMPANY)#" null="#isCOMPANYNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.SECTORS1)#" null="#isSECTORS1Null#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.RANKING)#" null="#isRANKINGNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.PRICE)#" null="#isPRICENull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.DEPARTMENT1)#" null="#isDEPARTMENT1Null#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.FIRSTNAME)#" null="#isFIRSTNAMENull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.POS)#" null="#isPOSNull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.PHONE)#" null="#isPHONENull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.EMAIL)#" null="#isEMAILNull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MOBILE)#" null="#isMOBILENull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.ADDRESS)#" null="#isADDRESSNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.CITY)#" null="#isCITYNull#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.COMMENTS)#" null="#isCOMMENTSNull#" />,
    <cfqueryparam cfsqltype="cf_sql_timestamp" value="#MEETINGDATE#" />,
    <cfqueryparam cfsqltype="cf_sql_longvarchar" value="#trim(FORM.MTGT)#" null="#isMTGTNull#" />,
    <cfqueryparam cfsqltype="cf_sql_integer" value="#trim(FORM.STATE1)#" null="#isSTATE1Null#" />
    </CFQUERY>
    <!---DATE_FORMAT(datetime_field_name,'%Y-%m-%d');--->
    <CFLOCATION URL="testht.cfm?begin=1">
    </cfif>
    </cfif>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    <title>Sales</title> 
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="formst.css" type="text/css" media="screen" />
    </head>
    <cfdump var=#qnames#>
    <cfajaxproxy bind="javascript:myHandler({UsersGrid.COMPANY},{UsersGrid.SECTORS1},{UsersGrid.DEPARTMENT 1})"/>
    <script type="text/javascript">
      function myHandler(COMPANY,SECTORS1,DEPARTMENT1) {
          //update the link's href
          document.getElementById('myLink').href = 'http://www.google.com/search?q=' + COMPANY;
          document.getElementById('Linkedin').href = 'http://www.google.com/search?q=linkedin' + COMPANY;
          //update SECTORS1's selected
          var theField = document.getElementById('SECTORS1');
          for(var i=0; i<theField.options.length; i++) {
              if(theField.options[i].value==SECTORS1) {
                  theField.options[i].selected = true;
              } else {
                  theField.options[i].selected = false;
    </script>
    <!--- TOP --->
    <body>
    <div>
    <cfform name="SFORM" FORMAT="html"  width="1000" height="400" style="margin-left:140px;">
    <cfgrid name="UsersGrid"
               FORMAT="html"
               query="QNAMES" width="920" height="200" rowheaders="No" striperows="yes" striperowcolor="fefefe">
    <cfgridcolumn name="RANKING" width="40"header="Rank">
    <cfgridcolumn name="COMPANY" width="170" header="Company">
    <cfgridcolumn name="FIRSTNAME"  header="Contact Name">
    <cfgridcolumn name="POS" width="160" header="Position">
    <cfgridcolumn name="DEPARTMENTNOM" width="150" header="Department">
    <cfgridcolumn name="SECTORSNOM" width="120" header="Sectors">
    <cfgridcolumn name="ABUNDANCE" width="120" header="Action date">
    <cfgridcolumn name="SECTORS1" width="120" header="Action date" display="no">
    <cfgridcolumn name="PRICE" width="120" header="Action date" display="no">
    <cfgridcolumn name="PHONE" width="120" header="Action date" display="no">
    <cfgridcolumn name="EMAIL" width="120" header="Action date" display="no">
    <cfgridcolumn name="MOBILE" width="120" header="Action date" display="no">
    <cfgridcolumn name="ADDRESS" width="120" header="Action date" display="no">
    <cfgridcolumn name="CITY" width="120" header="Action date" display="no">
    <cfgridcolumn name="COMMENTS" width="120" header="Action date" display="no">
    <cfgridcolumn name="MTGT" width="120" header="Action date" display="no">
       </cfgrid>
    <!---FIRST--->
    <table width="880" class="stat" >
    <tr><td><cfoutput>#QNAMES.RecordCount# Companies</cfoutput></td></tr>
    <tr>
    <td>Company:<cfinput class="input" type="text" name="COMPANY" size="20" label="Company" required="yes"  bind="{UsersGrid.COMPANY}" ></td>
    <td>
    Sector:<cfselect class="input" name="SECTORS1" size="1" label="Sector" required="yes">
    <option></option><cfoutput query="industries"><option value="#SECTORSIDS#">#SECTORSNOM#</option></cfoutput></cfselect>
    </td>
    <td>Ranking:<cfinput class="input"  type="TEXT" name="RANKING" size="3" label="Ranking" bind="{UsersGrid.RANKING}" ></td>
    <td>Price:<cfinput class="input" type="TEXT" name="PRICE" size="3" label="Price" bind="{UsersGrid.PRICE}" >
    <a href="" id="myLink" target="_blank">Google</a>
    <a href="" id="Linkedin" target="_blank">Linkedin</a></td>
    </tr>
    <tr>
    <td>Department:<cfselect class="input" name="DEPARTMENT1" size="1" label="Department" required="yes">
    <option></option><cfoutput query="dNames"><option value="#DEPARTMENTIDS#">#DEPARTMENTNOM#</option></cfoutput></cfselect>
    </td>
    <td>Name:<cfinput class="input" type="text" name="FIRSTNAME" label="Name" required="yes" width="150" bind="{UsersGrid.FIRSTNAME}" ></td>
    <td>Position:<cfinput class="input" type="text" name="POS" label="Position" width="150" bind="{UsersGrid.POS}" ></td>
    <td>Phone:<cfinput class="input" type="text" name="PHONE" label="Phone" width="150" bind="{UsersGrid.PHONE}" ></td>
    </tr>
    <!--- THIRD--->
    <tr><td>Email:<cfinput class="input" type="text" name="EMAIL" label="Email" width="150" bind="{UsersGrid.EMAIL}" ></td>
    <td>Mobile:<cfinput class="input" type="text" name="MOBILE" label="Mobile"  bind="{UsersGrid.MOBILE}" ></td>
    <td>Address:<cfinput class="input" type="text" name="ADDRESS" label="Address"  bind="{UsersGrid.ADDRESS}" ></td>
    <td><cfselect class="input" name="CITY" width="80" size="1" >
    <cfoutput query="xity"><option value="#CITYID#">#CITYNOM#</option></cfoutput>
    </cfselect></td>
    </tr> 
    <!--- FOURTH --->
    <tr><td>Comments:<cftextarea class="input" name="COMMENTS" height="60"  label="Comments" bind="{UsersGrid.COMMENTS}" /> </td>
    <td>Action:<cfinput type="DateField" class="input" size="10" name="ABUNDANCE" label="Action"  bind="{UsersGrid.ABUNDANCE}" ></td>
    <td>Time:<cfselect class="input" name="MTGT" width="90" label="Time"><option>7:00AM</option></cfselect></td>
    <td><cfselect class="input" name="STATE1"  size="1" label="Action" >
    <cfoutput query="salesstep"><option value="#SALESID#">#SALESNOM#</option></cfoutput>
    </cfselect>  </td>
    <cfinput type="hidden" name="ENTID" label="ENTID" bind="{UsersGrid.ENTID}" >
    </tr>
    <tr> <td> 
    <cfinput type="submit" name="DELCOM" value="delete" class="button" >
    <cfinput type="submit" name="UPDATEADDBTN" value="UPDATE or ADD NEW" class="button"></td>
    </tr>
    </table>
    </cfform>
    <cfif isDefined("FORM.DELCOM")>
    <CFQUERY name="deletecompany" datasource="tester">
    DELETE FROM COMPANY
    WHERE ENTID = #FORM.ENTID#
    </CFQUERY>
    <CFLOCATION URL="testht.cfm">
    </cfif>
    </div>
    </body>
    </html>

  • Cfselect data binding with statically defined options

    I am having some trouble getting statically defined options
    to remain in my cfselects when I use binding in CF8
    I have four cfselects: Continent, Country, State/Province,
    County
    The continent select is populated by a list in a database,
    and each subsequent select is populated depending on the continent
    value (your run-of-the-mill related select box model).
    I have a form that allows a user to edit an existing record
    that uses these select boxes. The form is populated with data from
    that existing record - for example, a record in which
    Continent=North America, Country=United States, State=Montana, and
    County=Meagher
    The problem is that when I define a static option based on
    what's already in the database:
    <cfselect name="continentSelect"
    bind="cfc:CF_Classes.places.getContinents()" bindonload="true">
    <option value="#
    defined continent name#" selected="selected">
    defined continent name</option>
    </cfselect>
    the static option is displayed only momentarily while the
    query is running and then disappears completely from the box once
    the box is populated. I have got the option to stay when I turn
    "bindonload" off, but even then when I trigger the binding the
    option disappears. I have been able to get it to stay when I use
    the old method of defining a query to populate the box, but then I
    lose the binding ability in subsequent boxes so that options I
    don't want to show are displayed (i.e. something like
    Continent=North America, Country=Japan).
    Maybe there isn't a way around this, but there is an example
    of this type of thing in the CFML reference for CF8. I haven't
    tested it so I don't know if that one works or not. Am I missing
    something?

    Hi,
    There are a couple of ways you can do this. One is where the dropdown would change the presence of static text objects. The other would be where the dropdown would set the actual text within a textfield.
    Sample here: https://acrobat.com/#d=k2tAeWMsKS0pEbhmWt33oA
    Good luck,
    Niall

  • CF11 - CFGRID & CFSELECT binding issue

    We just upgraded to CF11 and one of our apps had pieces stop functioning. We have figured out most of it, however one of our cfgrids is having issues. When the page is loaded the cfgrid hits the CFC that is specified in the bind settings (passes in the default employee ID of 0 and returns no data). When we select an employee name from the dropdown menu, we receive a 400 error saying the page can't be found. When the select is changed, it looks like it reverts to the root path instead of the cfc specific in the bind argument. Does anyone have any idea on the direction we should go to fix this? The exact same code works on CF8... but is completely broken on CF11.
    Thanks for your help.

    BKBK Sorry for the confusion... we set an array for the arguments, below is the full block of code.
    <cfform id="evaluation" name="evaluation">
    <div style="height:30px; margin-top:10px;">
    <div style=" margin-right:10px; float:left;">
    <cfselect name="employee" query="EmployeeList" value="affiliateID" display="empName" queryPosition="below">
    <option value="0" selected="selected">--- Select an employee ---</option>
    </cfselect>
    </div>
    </div>
        <cfset args = structNew()>
    <cfset args.name = "ExistingEvals">
    <cfset args.format = "html">
    <cfset args.bindOnLoad = "true">
    <cfset args.bind = "cfc:empEval.getCompletedEvals({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridso rtdirection},{employee})">
    <cfset args.stripeRows = true>
    <cfset args.selectColor = "##D9E8FB">
    <cfset args.selectmode = "row">
    <cfset args.selectOnLoad = "false">
    <cfset args.autowidth = "no">
    <cfset args.width = "335px">
        <cfset args.pageSize = "6">
    <cfset args.height = "200px">
    <div style=" margin-top:5px;">
    <cfgrid name="employeeEvals" attributeCollection="#args#">
    <cfgridcolumn name="empAffiliateID" display="no">
    <cfgridcolumn name="FY" display="no">
    <cfgridcolumn name="evaluationID" display="no">
    <cfgridcolumn name="typeID" header="Eval Type" display="yes" width="75">
    <cfgridcolumn name="FY" header="Fiscal Year" display="yes" width="90">
    <cfgridcolumn name="Status" header="Status" display="yes" width="125">
    <!---<cfgridcolumn name="Date" header="Date" display="yes">--->
    </cfgrid>

  • CFSELECT and BIND

    Hi
    I'm trying out cfselect with bind for the 1st time and I'm
    having 1 issue...
    I am trying to populate the 2nd cfselect with the zone_names
    AFTER i have selected the country_name in the 1st cfselect.
    the 2nd cfselect isnt populating!
    My database looks like this...
    All the data is in 1 table.
    table name = zones
    columns = zone_id, country_name, zone_name
    My cfm page is fairly simple...
    <cfform name="myform">
    <table>
    <tr>
    <td>Select Media Type:</td>
    <td><cfselect name="country_name"
    bind="cfc:art.getCountries()"
    bindonload="true" /></td>
    </tr>
    <tr>
    <td>Select Art:</td>
    <td><cfselect name="zone_name"
    bind="cfc:art.getzones({zone_name})" /></td>
    </tr>
    </table>
    </cfform>
    I have also attached my CFC code.
    My code probably isnt too neat right now, due to me spending
    hours trying to get this right...
    However, I would really appreciate someones help so that my
    2nd cfselect populates correctly!
    Thanks in advance
    Delon

    Hi
    I'm trying out cfselect with bind for the 1st time and I'm
    having 1 issue...
    I am trying to populate the 2nd cfselect with the zone_names
    AFTER i have selected the country_name in the 1st cfselect.
    the 2nd cfselect isnt populating!
    My database looks like this...
    All the data is in 1 table.
    table name = zones
    columns = zone_id, country_name, zone_name
    My cfm page is fairly simple...
    <cfform name="myform">
    <table>
    <tr>
    <td>Select Media Type:</td>
    <td><cfselect name="country_name"
    bind="cfc:art.getCountries()"
    bindonload="true" /></td>
    </tr>
    <tr>
    <td>Select Art:</td>
    <td><cfselect name="zone_name"
    bind="cfc:art.getzones({zone_name})" /></td>
    </tr>
    </table>
    </cfform>
    I have also attached my CFC code.
    My code probably isnt too neat right now, due to me spending
    hours trying to get this right...
    However, I would really appreciate someones help so that my
    2nd cfselect populates correctly!
    Thanks in advance
    Delon

  • Does ColdFusion MX 7 have cfselect bind option?

    Hi everyone,
                            In coldfsuion mx 7 does cfselect supports bind option which is supported by coldfusion 8.I have seen live docs for cfselect but in live docs it dint show any bind option for cfselect tag. If bind attribute is not present how we need implement related selects.
                           I have two cfselects in which the second should populate values by executing a query where the query takes the value that is selected in first cfselect.....how i need to approach this problem....for some reason bind option doesnt worked in coldfusion mx 7 which worked fine in coldfusion 8

    CFMX7's cfselect doesn't support binding. Binding in forms, in general, started from Coldfusion 8.
    The way to do binding in MX7 is to roll your own. This means writing the Javascript or Actionscript for it, and invoking it by means of an event-attribute like onChange.

  • Anyone using cfselect bind for 3 related fields?

    I have a form that a user needs to select the office from
    which will then populate the activity fields in the next drop down
    box and then he will pick the activity which would select the
    various dates that activity is run on. He would then pick from the
    date in the third box and submit. Unfortunatly, I'm only able to
    get 2 of the cfselect tags to bind correctly. Or if I could display
    two items in one box that would be a good workaround but that fails
    also. I've looked all over the livedocs and forums and haven't
    found using 3 or more. The error I get when I run the code with 3
    on the page is "Error invoking CFC /cmpts.cfc: Error executing
    database query." and also "Error invoking CFC/cmpts.cfc: The org_ID
    argument passed to the getCategoryArg function is not of type
    numeric." -It is numeric but I tried changing it anyway to "array",
    and "any" but then the error message reads "not of type array". If
    I comment out the last one it runs fine or if I comment out the
    first one (I'm removing the arguments passed in the cmpts.cfc code
    as well) and this runs fine. Below is my code. (Oh and even though
    the return value is data for all three in the cfc- using the same
    name works for 2 and I copied this straight from the livedocs so I
    didn't think that was the issue)
    Any suggestions? Thanks, Wendy
    <cfform name="test" method="POST"
    action="dumptest.cfm">
    <cfselect name="officeId"
    bind="cfc:cmpts.getOffices()"
    display="shortname"
    value="org_id"
    bindonload="true" />
    <!---based on the office select the activity --->
    <cfselect name="Activity"
    bind="cfc:cmpts.getCategoryArg({officeId})"
    display="title"
    value="id"
    />
    <!--- based on activity select the date --->
    <cfselect name="date"
    bind="cfc:cmpts.getdate({Activity})"
    display="date"
    value="date" />
    <input type="Submit" value="Submit">
    </cfform>
    <!--- cmpts.cfc below
    ------------------------------------------>
    <cfcomponent>
    <cffunction name="getOffices" access="remote"
    returntype="query" hint="Get's the Officename and id">
    <cfset var data="">
    <cfquery datasource="dsn1" name="data">
    select org_id,shortname
    from all_offices
    Where org_id <> ''
    order by shortname
    </cfquery>
    <cfreturn data>
    </cffunction>
    <cffunction name="getCategoryArg" access="remote"
    returntype="query" hint="Get's the category titles">
    <cfargument name="org_id" type="numeric"
    required="Yes">
    <cfset var data="">
    <cfquery datasource="dsn" name="data">
    Select a.id,a.title,b.org_id,convert(varchar,b.date,101) AS
    date
    from km_activities a,km_work b
    Where b.org_id= '#trim(ARGUMENTS.org_id)#'
    and a.id =b.act_id
    Order by a.id
    </cfquery>
    <cfreturn data>
    </cffunction>
    <cffunction name="getdate" access="remote"
    returntype="query" hint="Get date of activities to update">
    <cfargument name="id" type="any" required="Yes">
    <cfset var data="">
    <cfquery datasource="dsn" name="data">
    Select convert(varchar,date,101) AS date,office_id,act_id
    from km_work
    Where act_id = '#trim(ARGUMENTS.id)#'
    Order by date
    </cfquery>
    <cfreturn data>
    </cffunction>
    </cfcomponent>

    Hello
    This file is created when a folder or project is downloaded from the Dimensions Server using JDeveloper. If you create a dimensions connection and then using the versioning navigator (View -> Team -> Version Navigator) open the connection and navigate to the folder you want to work on. Select the folder and use the context menu "Download" to download the folder.
    Dave

  • Cfselect bind to keypress and onChange?

    Here's a quickie (I think):
    I want to bind a cfdiv to a cfselect. I want the div to
    refresh whenever the cfselect value changes, whether the change is
    caused by a mouse select or a keyboard. The default action for
    binding the div to the cfselect seems to be onChange, which (at
    least in Firefox 2) only refreshes on a mouse click; changing it to
    keypress only refreshes it on (surprise) using the keyboard to
    change the value.
    What's the easiest way to get it to refresh regardless of how
    the cfselect value is changed?

    anybody?

  • cfselect with bind to cfc works but is followed by 500 Jrun javax.servlet.ServletException

    All;
    This is driving me crazy. 
    I have a CFC with a function that returns countries via remote as JSON with the // prefix as Cold Fusion is configured.
    I call it with the following url
    www.mydomain.com/getCountriesAndStates.cfc?method=getCountries&returnFormat=json&argumentC ollection={}&_cf_nodebug=true&_cf_nocache=true
    It returns countries according to the Cold Fusion specs (just imagine it returning all countries, didn't want to paste it all the countries here).
    //[[0.0,"Please select a country..."],["US","UNITED STATES"],["CA","CANADA"]] 
    I bind a <cfselect for countrycode to this CFC and it works about 30% of the time.
    Here is the <cfselect
    <cfselect name="CountryCode" id="spanCountryCode" bind="cfc:getCountriesAndStates.getCountries()" bindonload="true"  onChange="DEdetermineTohide(this.id, '1')" onKeyUp="DEdetermineTohide(this.id, '1')">   
            </cfselect>
    It has a second function that returns the States with a CountryCode as the argument. 
    I call it with the follow url
    /getCountriesAndStates.cfc?method=getStateProvince&returnFormat=json&argumentCollection={" countrycode":"US"}&_cf_nodebug=true&_cf_nocache=true
    It returns states according to the old Fusion specs (just imagine it returning all the states, didn't want to paste all the states here.)
    //[[0.0,"Please select a state..."],["AL","ALABAMA"],["AK","ALASKA"]]
    I bind a <cfselect to this CFC with the countrycode as an argument and it populates the states for the countrycoe about 30% of the time.  It fails when the getCountries call fails.
    Here is the State <cfselect
    <cfselect name="StateCode" bind="cfc:getCountriesAndStates.getStateProvince({CountryCode})">
            </cfselect>
    I have a third funtion that returns whether or not the country selected has States and Zip Codes.  I call this function from a seperate javascript script included in the header and fired from the <cfselect name="CountryCode for onChange or onKeyUp.  It basically determines whether or not to show or hide both the State or Zip span but calls the CFC so that I can encapsulate everything in one place.  So the state and zip span with <cfselect and <cfinput appear and disappear based on the information about the country and state and the labels can change too from State to Province and from Zip to Postal Code etc...
    /getCountriesAndStates.cfc?method=getStateZipMetaData&returnFormat=json&argumentCollection ={"countrycode":"US"}&_cf_nodebug=true&_cf_nocache=true
    Ok, so I hope I have described enough about what I am doing.  This works about 30% of the time and fails about 70% of the time.  Flawlessly.  Sometimes it works for hours.  But eventually for some reason AFTER a perfectly good JSON response is returned from Cold Fusion, the Cold Fusion server starts following the JSON response with a 500 Serverlet Exception error.  This happesn on all function calls until I reboot my machine.
    It is driving me mad and making me start to reconsider whether or not I want to use CFForm binding.  It seems like a nice elegant solution that really simplifies and reduces the amount of javascript I have to write, but I can't go to production with forms that produce 500 server errors.
    Anyone have any ideas on what is going on?  If this is a bug?
    Should I just stay away from <cfform binding?
    Please help because it is driving me really crazy.
    My platform information is below.
    About 70% of the time it returns all the countries followed by a 500 Servlet Exception error.
    500
    javax.servlet.ServletException
         at coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:154)
         at coldfusion.xml.rpc.CFCServlet.doGet(CFCServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
         at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
         at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
         at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
         at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
         at jrun.servlet.FilterChain.service(FilterChain.java:101)
         at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
         at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
         at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
         at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
         at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
         at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
         at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
         at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
         at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    Platform details
    Server Product
    ColdFusion
    Version
    9,0,0,251028 
    Edition
    Developer 
    Operating System
    Windows XP 
    OS Version
    5.1 
    Adobe Driver Version
    4.0 (Build 0005) 
    JVM Details
    Java Version
    1.6.0_14 
    Java Vendor
    Sun Microsystems Inc. 
    Java Vendor URL
    http://java.sun.com/ 
    Java Home
    C:\ColdFusion9\runtime\jre 
    CF9 Update 1
    Apache 2.2
    Database MS-SQL Express

    Ok, so I think I answered this for myself.  This may be ignorant.  Whatever.  I haven't programmed CF in over 10 years and just started again a month ago, so I think advanced CFC and javascript is a lot.
    I seperated my CFC into a directory with a Alias mapping under Apache and a CF Mapping from CFIDE
    I trimmed down the application.cfc
    It was
    <cfset This.clientstorage="Cookie">
    That was causing the remoting CFC's to return a 500 Jrun Servlet Error
    I am just going to keep my remote CFC's seperate from the rest of my application anyway because they need a different type of security schema.
    So, if anyone struggles with this.  I recommend just put your remotely accessd CFC's in a seperate virtual directory mapped from your webserver and CF and lock them down both with a trimmed down application.cfc and some kind of security.
    They also seem to run much faster now combined with my other Ajax and Javascript.

  • Cfwindow cfselect binding issue

    In my CFWindow I have a couple of dependent dropdowns that is built by cfselect bind operation. The CFwindow opens using a Javascript on click of a link. In my parent window I have several links each opens the same cfwindow (same codebase) and I put diffrent window name while poping up the window to avoid caching issue. Now when I open the first cfwindow all cfselect drop downs and binding works fine. Then I close that cfwindow using the [X] button in the cfwindow and again opens another cfwindow (same code base) the cfselect binding doesn't work. It work only when I refresh the parent window and then click on to open another cfwindow it works fine. Apreciate your help

    The problem is the windows have different names.  I had a similar issue on a page I had that called two different CFWindows on the same parent page.  Both had different names, and both used the onclick to call a JS function(two different JS functions), that used ColdFusion.Windows.Create.  Even though I set destroyOnClose = true and had code to close and destroy the windows, for some reason it was causing issues on the binds.  Everything but the binds worked. The page has three different edit windows on it and only the two that have binding broke.   I am using CF 9.  For this fix to work you need to know the name of the window.  However, by using this method, you most likely would not have to use dynamic window names, because the window will be destroy on the onclick.  For your example I would just use the same window name.  Then put the try catch code below at the top of the function.  But if you have different window names opening on the same parent page, it's best to give each one a try catch of it's own.  I hope this makes sense.
    This might help:  http://www.coldfusionjedi.com/index.cfm/2008/9/26/Ask-a-Jedi-Another-CFWINDOW-Example
    In my Javascript I have these lines at the beginning
              try { ColdFusion.Window.destroy('WindowName1',true); }
                   catch(e){}
             try { ColdFusion.Window.destroy('WindowName2',true); }
                   catch(e){}
             Then i have the code to create my window.  I put this line of code in both Javascript functions.

  • Cfselect selected with bind

    I have a cfselect that is being populated by cfc remotely,
    how do I have an option selected by default? Using the selected
    attribute does not work, nor does hardcoding an option.
    Is there a way to define which option should be selected in
    the cfc results?
    Code:
    <cfselect name="propertyType"
    bind="cfc:/com/form.getPropertyTypes()" bindonload="true"
    ></cfselect>

    kyle969 wrote:
    > The first value in the list is selected by default if
    none are marked as
    > 'selected'. As I said, this is hokey and there has to be
    a better way.
    >
    > I have run into a situation where I have a multiple
    select box and I need
    > multiple selections automatically selected.
    >
    > Any ideas?
    >
    > Anyone?
    >
    follow-up:
    anyone still looking for solution to this:
    good old fellas ray camden and tod sharp have solved it
    here:
    http://www.coldfusionjedi.com/index.cfm/2007/8/7/Selecting-default-items-using-ColdFusion- 8s-AJAX-Controls
    and here:
    http://cfsilence.com/blog/client/index.cfm/2007/8/7/Selecting-Multiple-Default-Items-With- ColdFusion-8-Ajax-Controls
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Cfselect with bind truncates leading zero

    Banging my head against this one. I have two cfselect menus using bind. The first one populates the second. It's working fine except for this one wrinkle: the second select menu gets populated with zip codes. If they have leading zeroes (e.g. 02842) the zero gets clipped. The datatype in MySQL is char(5).
    If I just throw a regular query on the data and dump it it comes back with the zeroes fine.
    Bug? Workaround?
    CF8 BTW.
    Thanks.

    Here is an example of related selects without using binds.  http://www.pathcom.com/~bracuk/code/RelatedSelects.htm
    It may or may not be appropriate for your situation.  I remember something on these forums a few years back about performance problems if you used this approach with too much data.

  • CFSELECT  bind to cfc

    I copied the cfm and cfc code directly from livedocs for
    CFSELECT. When I run it, nothing happens.
    When I view the javaScript console I see the error
    _31c has no properties in file
    CFIDE/scripts/ajax/package/cfajax.ja line:1264
    Which is :
    if(typeof
    (_31c.length)=="number"&&!_31c.toUpperCase){
    The ajax debug console has this:
    info:http: CFC invocation response:
    info:http: HTTP GET
    /com/form.cfc?method=getMarkets&returnFormat=json&argumentCollection=%7B%22pPropertyType% 22%3A%22ind%22%7D&_cf_nodebug=true&_cf_nocache=true&_cf_clientid=040CA886EBC6022C6B3CF49B5 7FAC070&_cf_rc=0
    info:http: Invoking CFC: /com/form.cfc , function: getMarkets
    , arguments: {"pPropertyType":"ind"}
    info:LogReader: LogReader initialized
    info:global: Logger initialized
    BTW: I copied the /CFIDE/scripts directory to the webroot
    where I am working, I have checked that all of the included js
    files are present.
    Any ideas?

    i wouldn't call that a solution though, if you have a header within your onRequest, now you have to manually add it to all your pages!

Maybe you are looking for