• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CF11 - CFGRID & CFSELECT binding issue

New Here ,
Jan 30, 2015 Jan 30, 2015

Copy link to clipboard

Copied

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.

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 31, 2015 Jan 31, 2015

Copy link to clipboard

Copied

Could you show us the value of the bind attribute?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 03, 2015 Feb 03, 2015

Copy link to clipboard

Copied

Here is the cfselect that drives holds the employee number:

<cfselect name="employee" query="EmployeeList" value="affiliateID" display="empName" queryPosition="below">

<option value="0" selected="selected">--- Select an employee ---</option>

</cfselect>

Here is the bind statement:

<cfset args.bind = "cfc:empEval.getCompletedEvals({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{employee})">

On page load, the grid binds to the data based on the employee number of 0 (which is right since that is what is defaulted). However, no subsequent bind happens when {employee} changes. It used to work perfectly fine on CF7 and now doesn't work since we upgraded to CF11.

Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 03, 2015 Feb 03, 2015

Copy link to clipboard

Copied

jjdavis84 wrote:

Here is the bind statement:

<cfset args.bind = "cfc:empEval.getCompletedEvals({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridso rtdirection},{employee})">

Sorry, the bind statement is something like

<someTag bind="some_value"> 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 03, 2015 Feb 03, 2015

Copy link to clipboard

Copied

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},{cfgridsortdirection},{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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 03, 2015 Feb 03, 2015

Copy link to clipboard

Copied

I think you need to add the onChange attribute when you bind in an HTML editable grid. That is, something like

<cfset args.onChange ="cfc:empEval.editEmployee({cfgridaction},{cfgridrow},{cfgridchanged})">

Then add the following function in empEval.cfc:

<cffunction name="editEmployee" access="remote" output="false">

    <cfargument name="gridaction">

    <cfargument name="gridrow">

    <cfargument name="gridchanged">

     <!--- Dummy function: empty functionality --->

</cffunction>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 03, 2015 Feb 03, 2015

Copy link to clipboard

Copied

The grid is not editable. What happens is, the grid is susposed to repopulate with new data based on the select form input. So, if we change from the default value (--- Select an employee ---) which shows no results to an employee name listed in the drop down, the grid should recall the cfc function and populate the grid with the updated information. If another employee is then selected, the grid will update accordingly. We are not editing any employee information, just updating the values displayed in the grid.

Thoughts?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 04, 2015 Feb 04, 2015

Copy link to clipboard

Copied

LATEST

I have now looked at your code in some detail. It looks fine: it should work. Here are some more thoughts.

1) Verify that the file empEval.cfc is infact in the current directory.

2) To eliminate caching issues, go to the ColdFusion Administrator and clear the cache of class files and components. Does it help?

3) Temporarily rename the file empEval.cfc to empEval2.cfc, and replace empEval by empEval2 in the expression <cfset args.bind = ...>. What happens then?

4) Test by temporarily changing to <cfset args.bindOnLoad = "false">. What happens then?

What do the ColdFusion logs say? Could you show us the stack trace?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation