tracker issue : CF-4048126

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

Filter NOT changing grid resultset

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): David Jacobson / David Jacobson (David Jacobson)

Created: 09/02/2015

Components: AJAX, UI Components

Versions: 11.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF11_Final / 2018.0.0.307449

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Win 2008 Server x64

Vote Count: 1

Problem Description: When entering a value in a search field and filtering the grid data, the value of the field doesn't get passed to the cfc query for the grid as previous before 4.x upgrade.

Steps to Reproduce:

Actual Result:

Expected Result:

Any Workarounds:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4048126

External Customer Info:
External Company:  
External Customer Name: David Jacobson
External Customer Email:  
External Test Config: My Hardware and Environment details:


  1. August 03, 2017 00:00:00:


After upgrading our shared hosting server from CF9 to CF11 all of our grids broke. I've managed to get the toolbars back with several form elements but those elements' values are not getting passed to the CFC to filter the grid data. This worked perfectly in CF9. Does any know what may have changed? javascript Data: tbar.add( { xtype: 'textfield', name: 'searchfield', fieldLabel: 'Search' }, { xtype: 'comboAge', handler: test }, { xtype:'button', text:"Filter Grid", tooltip:"Filter Grid", handler:function(){ColdFusion.Grid.refresh('empGrid')} },'-->', { xtype:'button', text:"Add User Account", tooltip:"Add a user account", handler:addUserAccount} ); var getSearch = function() { try { //alert(Ext.getDom('searchfield').value); return Ext.getCmp('searchfield').getValue(); } catch (e) { return ""; //return default value in case of error. } } GRID CODE: <cfgrid format="html" name="empGrid" width="800" pagesize=15 sort=true title="Team Database" collapsible="false" insert="yes" delete="yes" bind="cfc:grid.getAllTeams({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdi rection},getSearch())"> <cfgridcolumn name="TeamID" display="true" header="ID" /> <cfgridcolumn name="TeamName" display="true" header="Team Name"/> <cfgridcolumn name="Age" display="true" header="Age"/> </cfgrid>
Comment by External U.
6069 | September 02, 2015 09:59:24 AM GMT
It is due to changes in extra ... See the release notes. "ColdFusion.Grid.refresh does not work when the bind attribute used is a JavaScript bind."
Comment by External U.
6070 | September 02, 2015 04:39:14 PM GMT
Changes in extjs not extra ... Silly autocorrect.
Comment by External U.
6071 | September 02, 2015 04:40:52 PM GMT
Hi David and Stephen, The only workaround I found was to bind to a hidden input field. I agree this regression should be fixed. Here is a workaround: index.cfm -------------- <html> <head> <InvalidTag> var myGridInit = function() { var grid = ColdFusion.Grid; var tbar = grid.getBottomToolbar('myGrid'); tbar.add({xtype:'textfield', id:"myTextField", name:"myTextField", fieldLabel:"Search"}); //tbar.add({xtype:'button', text:"Filter Grid", tooltip:"Filter Grid", handler:function(){ColdFusion.Grid.refresh('myGrid')}}); tbar.add({xtype:'button', text:"Filter Grid", tooltip:"Filter Grid", handler:myButtonHandler});//workaround } var myBindFunction = function() { try { return Ext.getCmp('myTextField').getValue(); } catch(e) { return "broke"; } } var myButtonHandler = function() { document.getElementById('myHiddenInput').value = Ext.getCmp('myTextField').getValue();//workaround ColdFusion.Grid.refresh('myGrid'); } </script> </head> <body> <cfform> <!---<cfgrid name="myGrid" format="html" bind="cfc:MyCFC.myFunction({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},myBindFunction())" onLoad="myGridInit">---> <cfgrid name="myGrid" format="html" bind="cfc:MyCFC.myFunction({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{myHiddenInput})" onLoad="myGridInit"><!--- workaround ---> <cfgridcolumn name="myColumn" header="my column"> </cfgrid> <cfinput type="hidden" name="myHiddenInput"><!--- workaround ---> </cfform> </body> </html> MyCFC.cfc ---------------- component { remote struct function myFunction(numeric gridPage, numeric gridPageSize, string gridSortColumn, string gridSortDirection, string myArg) { return queryConvertForGrid(queryNew("myColumn", "varchar", [[ARGUMENTS.myArg]]), ARGUMENTS.gridPage, ARGUMENTS.gridPageSize); } } Enter a value into the grid text field, then click "Filter Grid" and see same value displayed in the grid. Note the following: 1) added hidden input 2) binding to hidden input in cfgrid's bind attribute 3) in button handler, setting hidden input's value equal to grid text field's value Hope that helps!, -Aaron
Comment by External U.
6072 | September 02, 2015 11:58:31 PM GMT
Bug tracker replaced the opening script tag w/ <InvalidTag>.
Comment by External U.
6073 | September 03, 2015 12:00:43 AM GMT
+1 - the regression should be fixed
Vote by External U.
6081 | September 03, 2015 12:01:26 AM GMT
That's awesome Aaron, thank you! I will try it out.
Comment by External U.
6074 | September 03, 2015 07:33:01 AM GMT
Hi David, You're very welcome. Please let me know if there are any questions. Thanks!, -Aaron
Comment by External U.
6075 | September 03, 2015 02:29:27 PM GMT
Aaron, Okay, so I've got the text field working with the grids as you mentioned. But, most of my grids have dropdowns, how does that differ than the textfield? I can't seem to get that to work like the textfield, am I missing something?
Comment by External U.
6076 | September 06, 2015 09:35:35 AM GMT
Hi David, Very cool that the text fields are working. I believe Ext.getCmp('myComboBox').getValue() would get the selected value from a combo box named myComboBox. If you can post the updated grid & JS code, I could see if I notice anything that would need to change. Thanks!, -Aaron
Comment by External U.
6077 | September 07, 2015 04:14:48 AM GMT
Okay Aaron, I'm almost back to normal with my stuff. I have another issue I have run into and cannot for the life of me figure it out. I am trying to open a cfwindow via javascript, the code worked before the upgrade and now all I get is the modal part and no window. Any ideas? From the code below I get the alert and then the modal. When I look at it in Firebug I see the correct response but no window. ARGH!!!! <a href="##" onClick="editAccounting(#regID#);"> <img src="../../_images/icon_edit.png" width="15" height="15" align="absmiddle" alt="Edit Registration"/> </a> var editAccounting = function(regID) { alert(regID); try { ColdFusion.Window.destroy('acctWindow',true); } catch(e) { ColdFusion.Window.create('acctWindow', 'Event Registration Information', 'payment/testData.htm?regID='+regID, {height:575,width:800,modal:true,closable:true,draggable:true,resizable:false,center:true});'acctWindow'); ColdFusion.Window.onHide('acctWindow',AcctCleanup); } };
Comment by External U.
6078 | September 09, 2015 07:55:15 PM GMT
Hi Adobe, I see this ticket's Status/Reason is "To Test/NeedMoreInfo". I've attached containing the code that should run. Just enter text in search box, then click "Filter Grid" button. The "my column" grid column should then display the text you entered. If the grid displays "broke", then the issue isn't fixed yet. Thanks!, -Aaron P.S. Could you please make CF-3709024 visible again? It's listed in CF11's Release Notes. It is also referenced in an earlier comment on this ticket.
Comment by Aaron N.
6079 | August 03, 2017 07:48:31 AM GMT
Note: I also tested the code in CF2016 Update 4 - and still see "broke" displayed in the grid.
Comment by Aaron N.
6080 | August 03, 2017 07:50:09 AM GMT