#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    12
    Rep Power
    0

    Adding html, formatting or "includes" on application.cfm kills my grid. Please assist


    I have a CFGRID that works fine if I put html on the page that the grid is on or if I use cfinclude on that page. If I put any html or "cfincludes" in my application.cfm page... it kills my grid and I get an "Exception thrown and not caught" error.

    Does anyone have a suggestion on how I can address this? I'd like to put all of my formatting/includes in the application.cfm page so any other cfm pages created on my website automatically load these things.

    Thank you.
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,243
    Rep Power
    967
    Sorry, I'm not sure what's going on. You can definitely have HTML or cfincludes in an Application.cfm file.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    12
    Rep Power
    0
    Originally Posted by kiteless
    Sorry, I'm not sure what's going on. You can definitely have HTML or cfincludes in an Application.cfm file.
    Yes, it works fine with all other cold fusion stuff on my pages but it breaks my cfgrid. I believe this explains my issue but I am not having any luck with implementing it: http://forums.forta.com/messages.cfm?threadid=10C19539-E898-C4C8-5F32EBA5B054C3D6
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    12
    Rep Power
    0
    This person is having the same issue that I am talking about. I find many people with this issue but no solutions that I can make work or understand. Can anyone assist?
    http://www.coldfusionjedi.com/forums...55CBB4F778AF#8
  8. #5
  9. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,243
    Rep Power
    967
    I've certainly never heard of this, but without more information I can't really tell you what's going on because I have no idea what you're doing.

    As an aside, most CF developers don't just throw a ton of output code in their Application.cfm/Application.cfc file. They use an MVC framework like FW/1 or Model-Glue that supports layouts and templates. It's probably been 10 years since I put output code in an Application.cfc. Keep in mind that if you put output code in an Application.cfm/cfc file, it will add that output to EVERY request, including AJAX requests. Same with debugging info appended to the end of a request. Either of which will obviously make any JSON or XML returned unusable.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    12
    Rep Power
    0
    Originally Posted by kiteless
    Keep in mind that if you put output code in an Application.cfm/cfc file, it will add that output to EVERY request, including AJAX requests. Same with debugging info appended to the end of a request. Either of which will obviously make any JSON or XML returned unusable.
    Yes, that is my issue and that is what is breaking my cfgrid. It is sending the formatting etc with my ajax requests. Do you have a recommendation on how I can accomplish the same type of thing as putting html in my application.cfm? I don't have control at the server level so all of my formatting etc has to be done on my "web" space. Am I forced to add includes to the .cfm page itself?

    Thanks again.
  12. #7
  13. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,243
    Rep Power
    967
    Well like I said it's really been 10 or more years since I had to deal with this, long before AJAX. That said, one thing you might try is adding another Application.cfm file in the root directory of the CFCs you are binding to from your grid. Copy anything relevant from your main Application.cfm to this child Application.cfm. If you use cfapplication, make sure they use the same application name. But do not copy any layout code or layout includes. To be safe, wrap the whole file in cfsilent tags.

    Since the CF server starts at the target folder and then works back up the folder hierarchy looking for an Applicaiton.cfm file to run, it should run your new one instead of the root one. Your child Application.cfm should have no output in it, especially if it is wrapped by cfsilent (which suppresses all output inside it).

IMN logo majestic logo threadwatch logo seochat tools logo