Highlighted

CFGRID, was working in CF8 won't display results in CF11

Engaged ,
Jul 01, 2014

Copy link to clipboard

Copied

Hi

I recently upgraded a client from CF 8 to CF 11.

In the code is a CFGRID which was working in CF8 but now in CF11 the grid displays but no data appears (the grid is simply empty).

With debugging enabled the Coldfusion Ajax Logger is reporting the following error:

Uncaught SyntaxError: Unexpected identifier (http://hiddenServer.com/index.cfm?action=job.manageJobOperations&jobId=2395&cfdebug, line 104)


Line 104 is the "</cfgrid>" tag.


Here is cfgrid code, complete with it's bound cfselect statement immediately before it:

<cfselect name="primarysupplier" query="getconcretecompanies" display="name" value="id" required="yes"  />

<cfgrid name="mixdesigns" format="html" bind="cfc:controller.Controller.getMixDesign({primarysupplier},{cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{primaryconcrete:jobid})" bindonload="yes" height="400" selectmode="row" sort="yes" selectonload="false">

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

                                <cfgridcolumn name="selectcode" select="yes" display="yes" header="Select" width="40" />

                                <cfgridcolumn name="shortcompanyname" display="yes" header="Supplier" width="75" select="no" />

                                <cfgridcolumn name="mixnumber" display="yes" header="Mix Number" width="75" select="no" />

                                <cfgridcolumn name="psistrength" display="yes" header="PSI" width="45" select="no" />

                                <cfgridcolumn name="cubicyardprice" display="yes" header="Price" width="50" select="no" />

                                <cfgridcolumn name="description" display="yes" header="Description" width="180" select="no" />

                            </cfgrid>

I've dumped the query that populates the cfselect and there are no empty rows.

The console at the bottom of Chrome simply reports the same error, "Uncaught syntaxError. Unexpected identifier".

Has anyone else encountered this issue? If nothing else I'd love to learn how to debug this error, it seems as if there is some extra data being fed to the cfgrid but I can't seem to trap it....

Anyone?

Thanks in advance for your help,

Rich

    

Views

2.6K

Likes

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

CFGRID, was working in CF8 won't display results in CF11

Engaged ,
Jul 01, 2014

Copy link to clipboard

Copied

Hi

I recently upgraded a client from CF 8 to CF 11.

In the code is a CFGRID which was working in CF8 but now in CF11 the grid displays but no data appears (the grid is simply empty).

With debugging enabled the Coldfusion Ajax Logger is reporting the following error:

Uncaught SyntaxError: Unexpected identifier (http://hiddenServer.com/index.cfm?action=job.manageJobOperations&jobId=2395&cfdebug, line 104)


Line 104 is the "</cfgrid>" tag.


Here is cfgrid code, complete with it's bound cfselect statement immediately before it:

<cfselect name="primarysupplier" query="getconcretecompanies" display="name" value="id" required="yes"  />

<cfgrid name="mixdesigns" format="html" bind="cfc:controller.Controller.getMixDesign({primarysupplier},{cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection},{primaryconcrete:jobid})" bindonload="yes" height="400" selectmode="row" sort="yes" selectonload="false">

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

                                <cfgridcolumn name="selectcode" select="yes" display="yes" header="Select" width="40" />

                                <cfgridcolumn name="shortcompanyname" display="yes" header="Supplier" width="75" select="no" />

                                <cfgridcolumn name="mixnumber" display="yes" header="Mix Number" width="75" select="no" />

                                <cfgridcolumn name="psistrength" display="yes" header="PSI" width="45" select="no" />

                                <cfgridcolumn name="cubicyardprice" display="yes" header="Price" width="50" select="no" />

                                <cfgridcolumn name="description" display="yes" header="Description" width="180" select="no" />

                            </cfgrid>

I've dumped the query that populates the cfselect and there are no empty rows.

The console at the bottom of Chrome simply reports the same error, "Uncaught syntaxError. Unexpected identifier".

Has anyone else encountered this issue? If nothing else I'd love to learn how to debug this error, it seems as if there is some extra data being fed to the cfgrid but I can't seem to trap it....

Anyone?

Thanks in advance for your help,

Rich

    

Views

2.6K

Likes

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
Jul 01, 2014 0
Adobe Employee ,
Jul 01, 2014

Copy link to clipboard

Copied

Likes

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
Reply
Loading...
Jul 01, 2014 0
Engaged ,
Jul 01, 2014

Copy link to clipboard

Copied

Hi Anit

Thanks for your response.

I didn't see that Adobe posted a fix for this, do you have a suggested workaround? It looks like the bug was closed, any ideas on how to fix this issue?

Thanks,

Rich

Likes

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
Reply
Loading...
Jul 01, 2014 0
Adobe Employee ,
Jul 01, 2014

Copy link to clipboard

Copied

Hi Rich,

The issue is fixed in ColdFusion 11 Update 1. That is why the bug is closed. You can go ahead and vote/subscribe to the bug.

Regards,

Anit Kumar

Likes

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
Reply
Loading...
Jul 01, 2014 0
Engaged ,
Jul 02, 2014

Copy link to clipboard

Copied

Hi Anit

I just ran the Coldfusion server update and it said that no updates were available.

The system information tab says I'm running Coldfusion version 11,0,0,289974

Is this not the most recent version of Coldfusion 11? Can you tell me how I get Update 1?

Thank you,

Rich

Likes

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
Reply
Loading...
Jul 02, 2014 0
Adobe Employee ,
Jul 02, 2014

Copy link to clipboard

Copied

Hi Rich,

The update is not live yet. We don't have an ETA for the update as of now.

Regards,

Anit Kumar

Likes

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
Reply
Loading...
Jul 02, 2014 0
Engaged ,
Jul 02, 2014

Copy link to clipboard

Copied

Anit

Do you have any suggested workarounds to get the cfgrid functionality working? Without a workaround I'll have to rip out the cfgrid functionality which represents a lot of work (and expense to my client).

What do you suggest we do until you publish the update?

Thanks again,

Rich

Likes

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
Reply
Loading...
Jul 02, 2014 0
Engaged ,
Jul 02, 2014

Copy link to clipboard

Copied

Anit

Could you please clarify?

In the Adobe bug report for this issue (Bug#3759630 - CFGRID with BIND to CFC failed for an incorrect JavaScript)

... it mentions

Build

Found In BuildCF11_Final

Fixed In Build289972

Doesn't that mean if the Coldfusion version that I'm running is Coldfusion version 11,0,0,289974, then my build would already have the fix rolled up in it? Or am I not reading the versioning correctly?

Thanks,

Rich

Likes

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
Reply
Loading...
Jul 02, 2014 0
Adobe Employee ,
Jul 02, 2014

Copy link to clipboard

Copied

That's a different version.

Likes

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
Reply
Loading...
Jul 02, 2014 0
New Here ,
Jul 01, 2015

Copy link to clipboard

Copied

I just updated to CF 11 Update 5 from CF 8, and I'm experiencing this exact thing - a CFGRID that was previously working in 8, I am just getting an AJAX spinner with an error in the JavaScript console about an error parsing the JSON returned from the CFFUNCTION. Any ideas why I'm seeing this, since it should have been fixed 4 updates ago?

Likes

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
Reply
Loading...
Jul 01, 2015 0
Adobe Employee ,
Jul 02, 2015

Copy link to clipboard

Copied

Hi Dave,

Can you check Home for existing bug, if any? If not, please log a new one.

Thanks

Regards,

Anit Kumar

Likes

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
Reply
Loading...
Jul 02, 2015 0
Community Beginner ,
Sep 15, 2015

Copy link to clipboard

Copied

Hi, I ran into this issue from CF9 to CF11, what you can do is:

1. Change the bind type of your CFGRID from cfc to javascript and only keep the default cfgrid parameters. You will define the javascript function later.


bind="cfc:controller.Controller.getMixDesign({primarysupplier},{cfgridpage},{cfgridpagesize},{c fgridsortcolumn},{cfgridsortdirection},{primaryconcrete:jobid})"
bind="javascript:getMixDesign({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"


2. Create a cfajaxproxy pointing to your cfc controller.Controller


<cfajaxproxy cfc="controller.controller" jsclass="proxy" />


3. Create a form with id="primaryconcrete" (it can be different you just have to know this to reference it later) and inside this form put hidden inputs with the name of your custom parameters or filter controls

<cfform name="primaryconcrete" id="primaryconcrete">

  <cfinput name="primarysupplier" value="#primarySuplierValue#" />

    <!--- This can be any other control --->

    <cfinput name="jobid" value="#jobIdValue#">

</cfform>


4. Create your javascript handler referenced in your bind attribute.

<script>

    getMixDesign = function(cfgridpage,cfgridpagesize,cfgridsortcolumn,cfgridsortdirection){

    //cfajaxproxy instance

      var instance = new proxy();

    // Get the values of the form controls to send them as arguments

    instance.setForm('primaryconcrete');

    //Return the json object obtained from the server

    return instance.getMixDesign(cfgridpage,cfgridpagesize,cfgridsortcolumn,cfgridsortdirection );

  };

</script>

Your cfc should remain intact.

I hope this will help.

Thanks.

Angel Chrystian

Likes

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
Reply
Loading...
Sep 15, 2015 0
Community Beginner ,
Nov 05, 2015

Copy link to clipboard

Copied

Trying adding his to the top of your grid code as this was a pretty easy work-around:

<body>

<cfsavecontent variable = "javascript">

<script type="text/javascript">

var grid;

function init() {

grid=ColdFusion.Grid.getGridobject('userGrid')

}

</script>

</cfsavecontent>

<cfhtmlhead text="#javascript#">

.... your grid code

</cfgrid>

</cfform>   <!--- if using a form --->

... Then add this to the bottom to load the grid.

<cfset ajaxOnLoad("init")>

</body>

It works in IE 11...  I haven't tried all browsers.

Joe

Likes

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
Reply
Loading...
Nov 05, 2015 1
Community Beginner ,
Nov 05, 2015

Copy link to clipboard

Copied

"userGrid" is the name of your grid, just to clarify.

Likes

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
Reply
Loading...
Nov 05, 2015 0
Community Beginner ,
Nov 05, 2015

Copy link to clipboard

Copied

Following up here, this works on one of my grids that actually has 2 cfforms on the page and a table within a table.  It has names down the left side of the page and then the grid displays all checking entries for whichever person you click on from the left.

I have no idea why it doesn't work on the simple one where all there is is just a grid.

Likes

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
Reply
Loading...
Nov 05, 2015 0
Explorer ,
Jan 06, 2016

Copy link to clipboard

Copied

Thanks Joe, worked perfectly for me.
Some minor adaptation as setting the init() function in my header <script></script> section but otherwise, worked like a charm !

Likes

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
Reply
Loading...
Jan 06, 2016 0