House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Bind issues - observation

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Stephens, Larry V
09/03/2010 11:18 AM

I'm sure this isn't news to most of you but perhaps there are one or two people out there struggling with CF and Ajax. Rewriting an application for CF that was originally done in Access has some challenges. Among them is display fields that are updated by an associated field. In my case (and this dates back to when space was an issue and dBase was a space hog) I didn't store (as one example) city, state and county information but linked it to the zipcode combobox. Select a different zipcode or add a new one (new oes are created, but I'm being generic here - this applies to other types of linked data) and the combobox query populated your related fields in a snap. CF, for obvious reasons, isn't as simple. I turned to binding. Part of my problem is having to use IE. We use ADS authentication and this app needs to be "behind" that for security. Mozilla chokes on ADS - at least here. But IE doesn't have anything as good as Firebug. (If I am wrong in saying this *please* point me to the tool.) After manipulating some stuff I temporarily moved the app out of the ADS area and opened it with Mozilla.  Thanks to some posts I found with Google and some advice from Tony Bentley and Raymond Camden I checked the XHR return values and found what was causing the errors. The error was thrown because of a bad JSON string. So, two pieces of advice: one problem was in Application.cfm. An old, old remark was html-remarked (<!-- -->) not CF-remarked and that was getting returned in the JSON string. The other issue was a footer file and another line of code in the OnRequestEnd.cfm  I had to go to a blank OnRequestEnd file. I don't recall that bit of advice anywhere in the CF docs. All is still not well. One variable return is nothing by cfdump CSS code despite there being no cfdump being used. I'm still figuring that out. One person advises looking at jquery instead of Ajax. We'll be trying that Thanks to those who helped. Larry Stephens

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Steve Milburn
09/03/2010 11:23 AM

Check out Firebug Lite that works among all major browsers, including IE - http://getfirebug.com/firebuglite <http://getfirebug.com/firebuglite>; On Fri, Sep 3, 2010 at 11:18 AM, Stephens, Larry V <stephenl@indiana.edu>wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Bentley
09/03/2010 01:20 PM

Larry, It sounds like your problem is mainly the architecture that you're dealing with. It is really important to understand modern Ajax (not the old Async JavaSript & XML) and how to finely tune Ajax JavaScript libraries to do what you want. More specifically how to handle Ajax debugging and browsers that will not output debugging information. For instance, there was no way to know that you were using an Application.cfm with html and OnRequestEnd.cfm and that your markup was junking up your Ajax response without seeing the body of your respose. Your test environment was not setup well enough to work through debugging Ajax (until someone pointed out Firebug). In my testing environment, I use Firebug in Firefox to debug EVERY SINGLE REQUEST. If you cannot debug your requests/responses and view JS errors, there is no way you can build an application that uses Ajax. Even if Firebug didn't exist, there are ways around it. For instance, before firebug many developers would just log each request and response and view logfiles to see their issues. I also use a TON of jQuery because it simplifies the complexity of JSON and DOM and allows rapid Ajax development and DOM manipulation. ColdFusion has some nice built in libraries and I have used all of them at one point or another but for the sake of being able to extend JavaScript as a real programming language, I now just write  scripts in jQuery and have them interact with ColdFusion components, returning JSON or strings or load a dynamic CFML page that takes care of all of the server side rendering that the browser might bark at (imagine using JSON & DOM manipulation to output 10,000 records in one go). The example I gave you in your earlier post gives you an example of both client and server rendering of a state change. Remember that you do not need to use Ajax for state change and that sometimes it is better to simply use DOM manipulation using JavaScript to change the state of your views and render it all on the server.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Faircloth
09/03/2010 01:44 PM

Amen to jQuery! Larry, It sounds like your problem is mainly the architecture that you're dealing with. It is really important to understand modern Ajax (not the old Async JavaSript & XML) and how to finely tune Ajax JavaScript libraries to do what you want. More specifically how to handle Ajax debugging and browsers that will not output debugging information. For instance, there was no way to know that you were using an Application.cfm with html and OnRequestEnd.cfm and that your markup was junking up your Ajax response without seeing the body of your respose. Your test environment was not setup well enough to work through debugging Ajax (until someone pointed out Firebug). In my testing environment, I use Firebug in Firefox to debug EVERY SINGLE REQUEST. If you cannot debug your requests/responses and view JS errors, there is no way you can build an application that uses Ajax. Even if Firebug didn't exist, there are ways around it. For instance, before firebug many developers would just log each request and response and view logfiles to see their issues. I also use a TON of jQuery because it simplifies the complexity of JSON and DOM and allows rapid Ajax development and DOM manipulation. ColdFusion has some nice built in libraries and I have used all of them at one point or another but for the sake of being able to extend JavaScript as a real programming language, I now just write  scripts in jQuery and have them interact with ColdFusion components, returning JSON or strings or load a dynamic CFML page that takes care of all of the server side rendering that the browser might bark at (imagine using JSON & DOM manipulation to output 10,000 records in one go). The example I gave you in your earlier post gives you an example of both client and server rendering of a state change. Remember that you do not need to use Ajax for state change and that sometimes it is better to simply use DOM manipulation using JavaScript to change the state of your views and render it all on the server.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Stephens, Larry V
09/03/2010 01:37 PM

Thanks. I do understand most of this and do use javascript in many cases. Looks like I need to bone up on jquery. Larry, It sounds like your problem is mainly the architecture that you're dealing with. It is really important to understand modern Ajax (not the old Async JavaSript & XML) and how to finely tune Ajax JavaScript libraries to do what you want. More specifically how to handle Ajax debugging and browsers that will not output debugging information. For instance, there was no way to know that you were using an Application.cfm with html and OnRequestEnd.cfm and that your markup was junking up your Ajax response without seeing the body of your respose. Your test environment was not setup well enough to work through debugging Ajax (until someone pointed out Firebug). In my testing environment, I use Firebug in Firefox to debug EVERY SINGLE REQUEST. If you cannot debug your requests/responses and view JS errors, there is no way you can build an application that uses Ajax. Even if Firebug didn't exist, there are ways around it. For instance, before firebug many developers would just log each!   request and response and view logfiles to see their issues. I also use a TON of jQuery because it simplifies the complexity of JSON and DOM and allows rapid Ajax development and DOM manipulation. ColdFusion has some nice built in libraries and I have used all of them at one point or another but for the sake of being able to extend JavaScript as a real programming language, I now just write  scripts in jQuery and have them interact with ColdFusion components, returning JSON or strings or load a dynamic CFML page that takes care of all of the server side rendering that the browser might bark at (imagine using JSON & DOM manipulation to output 10,000 records in one go). The example I gave you in your earlier post gives you an example of both client and server rendering of a state change. Remember that you do not need to use Ajax for state change and that sometimes it is better to simply use DOM manipulation using JavaScript to change the state of your views and render it all on the server.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andrew Scott
09/03/2010 05:57 PM

Or even cfajaxproxy built into ColdFusion. Check these tutorials out. http://www.andyscott.id.au/2010/8/27/How-to-handle-ColdFusion-session-time-o uts-with-Ajax-calls-and-ExtJS http://www.andyscott.id.au/2010/7/25/ColdFusion-and-populating-a-dropdown-ba sed-on-the-selection-of-another Regards, Andrew Scott http://www.andyscott.id.au/ ----- Excess quoted text cut - see Original Post for more ----- what ----- Excess quoted text cut - see Original Post for more ----- Ajax. > Even if Firebug didn't exist, there are ways around it. For instance, before > firebug many developers would just log each! >   request and response and view logfiles to see their issues. > > I also use a TON of jQuery because it simplifies the complexity of JSON and > DOM and allows rapid Ajax development and DOM manipulation. ColdFusion > has some nice built in libraries and I have used all of them at one point or ----- Excess quoted text cut - see Original Post for more ----- simply > use DOM manipulation using JavaScript to change the state of your views and ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

February 08, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29