Skip to main content
Inspiring
January 4, 2012
Question

CFGRIDCOLUMN combobox

  • January 4, 2012
  • 1 reply
  • 1720 views

Hi all

I have a bog-standard CFGRID that has one column which is a combobox. For some reason the combobox is displaying the value (an integer) rather than the text.

This is my code:

//This is the function that calls up the values for the combo box

<cfinvoke component="#application.comlib#.global" method="Get_Divisions" returnvariable="Get_Divisions">

<cfset lstDivID = ValueList(Get_divisions.divid)>

<cfset lstDivisions = ValueList(Get_divisions.division)>

//This is the grid

<Cfform name="fCategories">

     <cfgrid pagesize="20"

      name="CategoryGrid"

      format="HTML"

      bind="cfc:#application.comlib#.admin.Categories_Get({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"

      onchange="cfc:#application.comlib#.admin.Categories_Edit({cfgridaction},{cfgridrow},{cfgridchanged})"

      title="Categories"

      collapsible="true"

      selectmode="edit"

      delete="yes"

      insert="true"

      autowidth="true">

         <cfgridcolumn name="catid" display="no" />

         <cfgridcolumn name="divid" header="Division" type="combobox" valuesdisplay="#lstDivisions#" values="#lstDivID#"  />

         <cfgridcolumn name="category" header="Category"  />

         <cfgridcolumn name="style_suffix" header="Style Suffix" />

         <cfgridcolumn name="deleted" header="Deleted"  type="boolean" />

   </cfgrid>

</Cfform>

The query that returns the grid content basically looks like this:

SELECT catid, divid, category, style_suffix, deleted FROM categories

where divid is an integer.

When you click on the division column, the combo box renders correctly... it changes to a text value (division from lstDivisions). But if you are not actually in the cell, it displays the integer value (divid from lstDivID)

Am I missing something basic here?

**EDIT**

This problem was apparently fixed in CF 8 using a hotfix as outlined here: http://kb.adobe.com/selfservice/viewContent.do?externalId=kb403597&sliceId=2

We're using CF9.0.1 though....

Thanks

Neal

Message was edited by: Endboss_ZA

    This topic has been closed for replies.

    1 reply

    Inspiring
    January 17, 2012

    i don't know if this is the cause, but i've noticed you have an extra space between cfgridactio and n

    onchange="cfc:#application.comlib#.admin.Categories_Edit({cfgridactio n},{cfgridrow},

    Inspiring
    January 18, 2012

    Sorry but no.. that was some weird artifact of pasting the code.

    It looks like what I have described is a "feature", not a "bug". If this is true (and I hope it is not) then it is amazing that the CF developers did not forsee a need for the CFGRID to be used in tables that have foreign keys. What is the point of the valuesdisplay attribute if it does not work?