tracker issue : CF-4205182

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] ER for: Allow CFAJAX query column binding and preserveCaseForQueryColumn=true to play together

| View in Tracker

Status/Resolution/Reason: Open//

Reporter/Name(from Bugbase): Aaron N. / ()

Created: 09/06/2019

Components: AJAX, Plumbing

Versions: 2018

Failure Type:

Found In Build/Fixed In Build: /

Priority/Frequency: Normal /

Locale/System: / Windows 10 64 bit

Vote Count: 0

Issue: preserveCaseForQueryColumn=true breaks some CFAJAX query column binding

Confirmed in CF-4034418 and CF2018 Update 4 (build 2018.0.04.314546).

Repro:

Application.cfc
----------------------
component {
  THIS.name = "ticket_preserveCaseForQueryColumnBreaksSomeQueryColumnBinding";
  THIS.serialization.preserveCaseForQueryColumn = true;
}
----------------------

index.cfm
----------------------
<cfform>
  <cfselect name="mySelect" bind="cfc:MyCFC.getSelectData()" display="myDisplayColumn" value="myValueColumn" bindonload="yes" />
  <cfgrid name="myGrid" format="html" selectmode="edit" bind="cfc:MyCFC.getGridData({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})" onChange="cfc:MyCFC.setGridData({cfgridaction},{cfgridrow},{cfgridchanged})">
    <cfgridcolumn name="myValueColumn" select="no">
    <cfgridcolumn name="myDisplayColumn" select="no" href="myURLColumn" hrefkey="myValueColumn">
  </cfgrid>
</cfform>
----------------------

MyCFC.cfc
----------------------
component {
    remote function getSelectData() {
        return getData();
    }
    remote function getGridData(gridPage, gridPageSize, gridSortColumn, gridSortDirection) {
        return queryConvertForGrid(getData(), ARGUMENTS.gridPage, ARGUMENTS.gridPageSize);
    }
    remote function setGridData(gridAction, gridRow, gridChanged) {}
    private function getData() {
        return queryNew("myValueColumn,myDisplayColumn,myURLColumn", "integer,varchar,varchar", [[1,"one","./"],[2,"two","./"]]);
    }
}
----------------------

Actual Result: preserveCaseForQueryColumn=true breaks the binding b/c CFAJAX binding UPPERCASEs cfselect's display & value attribute values, as well as cfgridcolumn's href & hrefkey attribute values (and possibly others?).

Expected Result: Some way to allow CFAJAX query column binding and preserveCaseForQueryColumn=true to play together.

Possible ideas (open to any suggestions):
1) CF can fix the existing behavior, when preserveCaseForQueryColumn=true, transparently by internally making a separate HTTP request, using the bind attribute's value, to fetch the serialized query and then use its column names when generating the JS that powers the binding. This way there will always be an exact match between the serialized query names and the references in the JS.
-or-
2) A new preserveCaseForQueryColumnBind per-app setting that stops CFAJAX binding from UPPERCASING cfselect's display & value attribute values, as well as cfgridcolumn's href & hrefkey attribute values (and possibly others?).

Related ticket: CF-4034418

Attachments:

Comments: