Solved

CFGRID: Same .cfm page works fine on dev server but issues on prod server

Posted on 2010-09-16
11
319 Views
Last Modified: 2012-05-10
We have the same .cfm page that works fine on development server but has issues on production or ext server like:
- <cfset ajaxOnLoad("xxxxxx")> doesn't load correctly
- can't use mouse roller ball to scoll on data grid - wierd

cfgrid ="html"

Have these loaded:
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/ext-all.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/toolbar/toolbar.js"></script>  
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/button/button.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/menu/menus.js"></script>

Using CF8: all versions, patches and settings the same on both servers. Any ideas, hope this makes sense - it's driving us crazy!!

0
Comment
Question by:Nigel-SA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 6

Expert Comment

by:reiters
ID: 33693382
Use firefox with firebug and turn on the "console" it will help you to see what is being requested as well as what is being returned.  Is the ajaxonload calling an external link.  I think JS has some issues with external links.  They have to be handled a little different I think.  It's a security feature.  Also keep in mind that foo.com and www.foo.com are different domains to JS and will be treated as an external link.
0
 

Author Comment

by:Nigel-SA
ID: 33694702
Thanks Reiters looking into it, trouble is my work environment does not allow me to install FireFox :(   The webmaster ran it and showed me an image on a boat load of errors found on that page. Trying to get a waiver to use FF.  Any hints on what to look for?
0
 
LVL 6

Expert Comment

by:reiters
ID: 33695173
Any time you are using ajax, firebug is your best friend, but as you say you can not use it.  Fiddler2 is an alternative but if you can't have FF then you are probably not allowed that either.  CSS error are normal with JS libraries because they use the both IE and FF equivalents of how to do things knowing that the browser it doesn't belong to will ignore it.  Hope that made sense.  I had a hard time wording that.  JS errors on the other hand will halt JS execution.  If you have a JS error, the rest of your JS may not being run.  If the screenshot is all the JS errors then you should try to work through them and it may start working for you.
0
Automating Terraform w Jenkins & AWS CodeCommit

How to configure Jenkins and CodeCommit to allow users to easily create and destroy infrastructure using Terraform code.

 

Author Comment

by:Nigel-SA
ID: 33715131
Attached see the IE error that is displayed when the function is loaded on the ext server.
IE-Error-undefined.jpg
0
 
LVL 6

Expert Comment

by:reiters
ID: 33716698
Can you run the page and copy the rendered page and put it here.  You can remove anything company related.  It will be very difficult to troubleshoot the JS without being able to go over it.  I completely understand if you can't do that, but understand I can't troubleshoot without it.
0
 

Author Comment

by:Nigel-SA
ID: 33716750
Unfortunately I'm unable to, but I found on http://www.coldfusionguy.com/ColdFusion/blog/index.cfm/2007/11/28/CF8-AJAX-Features-Validating-CFGrid-Data

"Make sure that the <script> block that contains your init() javascript function is in within the <head> and </head> tags. The ext stuff can be picky if you don't define all your javascript functions in the head of the html."

I'll try this and see what happens - only tomorrow as the web guy is out today.
0
 
LVL 6

Accepted Solution

by:
reiters earned 500 total points
ID: 33717054
I've had many issues with running CFs UI stuff inside an AJAX loaded divs.  The thing throwing me off is that you stated it works on dev but not in production.

Something that might help that I found recently (been there for a long time).

<cfhtmlhead text='<link href="favicon.ico" rel="shortcut icon" type="image/x-icon">#chr(13)##chr(10)#'>

It allows you to put something in the <head> section of the page but it can be placed later on the page.  I assume CF sees those during the compiling of the page and moves it to the head.  That means it's great if you conditionally cfincluded pages, but will NOT work for AJAXed in content because those pages are called in after compile time.  For example.  I have a site that I work on that it really old code from a non-programmer and I do not want to include all the jQuery files across the whole site, but I added a form and wanted to use the calendar UI so I <cfhtmlhead> the jQuery files on my page and don't have to modify the global header file and the jQuery files will be in the head.

For running CF's UI stuff inside AJAXed div I have had to put functions on the main page that are then called from the ajaxonload from within the AJAXed content.  The function is just a wrapper for the call you want that resides on the main page but gets triggered from withing the AJAXed content.

One site I worked on had TONS of CF AJAX on it and after 6 months of fighting issues like these I switched to jQuery.  It's all smooth sailing from there.

Keep in mind that the way CF handles the AJAX it to "process" your javascript and in some cases rewrite it before it sends it to the browser.  If it can't figure out what you are trying to do it will just leave it out.  Very frustrating.

always use the format
foo  = function() {
}
and not
function foo() {
}

otherwise CF will just throw it out.

A lot of babbling there but since I can't see the code I'm trying to point you in the right direction.
0
 
LVL 6

Expert Comment

by:reiters
ID: 33717151
One last thing... In some cases it's much easier to use an IFRAME around some content.  I know some will hate me for saying that but it can be the only way sometimes.

Example: Try putting a video in a CFWindow using current "proper" method of creating the object using JS.  You will be fighting it AND it will work weird in IE.  I think you can move the window but the video stays in it's original location if I remember correct.

Remember that if you use an iframe that it will need its own
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/ext-all.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/toolbar/toolbar.js"></script>  
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/button/button.js"></script>
<script type="text/javascript" src="/CFIDE/scripts/ajax/ext/package/menu/menus.js"></script>

because they don't get pushed into iframes.
0
 

Author Comment

by:Nigel-SA
ID: 33725514
reiters - IT WORKS - thanks for all the input - turns out my error in the end was something real simple - I left out the </head> tag  :(  but hey, I learned tons of things from you - gotta love this programming!!!
0
 

Author Closing Comment

by:Nigel-SA
ID: 33725529
thanks for the comments
0
 
LVL 6

Expert Comment

by:reiters
ID: 33730950
Glad you figured it out.  The simplest thing can be the most frustrating.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
This article discusses how to implement server side field validation and display customized error messages to the client.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question