1. #1
    Ext JS Premium Member Gjslick's Avatar
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    129
    Vote Rating
    6
    Gjslick will become famous soon enough

      0  

    Default Ext.Direct and ColdFusion 9.0.1

    Ext.Direct and ColdFusion 9.0.1


    EDIT: This problem has been fixed with CF 9.0.1 hotfix 1. Installing it should solve the problem. http://kb2.adobe.com/cps/862/cpsid_86263.html


    Original post:

    Due to the ridiculous decision by Adobe to change ColdFusion's serializeJSON() function to serialize all data as strings in 9.0.1 (instead of numbers when applicable), Ext.Direct breaks.

    What happens is that callbacks won't be executed at all if a decimal is being added to 'tid' in the router (ex: changed from "1" to "1.0"), and even if you cast that back to an int (to bring it back to "1"), callbacks won't be executed in the correct scope due to the string 'len' in the method descriptions of the API.

    Here is an override that should restore the correct Ext.Direct functionality. Works with Ext 3.2.1.
    Code:
    Ext.override( Ext.direct.RemotingProvider, {
        initAPI : function(){
            var o = this.actions;
            for(var c in o){
                var cls = this.namespace[c] || (this.namespace[c] = {}),
                        ms = o[c];
                        
                for(var i = 0, len = ms.length; i < len; i++){
                    var m = ms[i];
                    m.len = +m.len;    // Make sure len is a number. Using unary + to coerce
                    cls[m.name] = this.createMethod(c, m);
                }
            }
        },
        
        getTransaction: function(opt){
            return opt && opt.tid ? Ext.Direct.getTransaction( +opt.tid ) : null;  // unary + to coerce to number
        }
        
    } );
    What you would do is put this override after you include the Ext files onto your page (after the <script> tags), but before you add the API description to Ext.Direct.addProvider(), such as this:
    Code:
    <link rel="stylesheet" type="text/css" href="ext-3.2.1/resources/css/ext-all.css" />
    <script type="text/javascript" src="ext-3.2.1/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="ext-3.2.1/ext-all.js"></script>
    
    <script type="text/javascript">
      // Include Override Here
    </script>
    
    <script type="text/javascript" src="api.cfm"></script>
    <script type="text/javascript">
      Ext.Direct.addProvider( Ext.ss.APIDesc );
    </script>
    Let me know if anyone needs an override for the PollingProvider. I don't personally use it, but I'll look into where fixes need to be made if someone does.

    Hope this helps someone in need.

    -Greg
    Last edited by Gjslick; 30 Sep 2010 at 8:40 AM. Reason: Added link to hotfix which should solve the problem.

  2. #2
    Ext User
    Join Date
    Dec 2009
    Posts
    22
    Vote Rating
    0
    davidsanderson is on a distinguished road

      0  

    Default


    Where do I put this? We also just upgraded to 9.0.1 and all of my grids are showing a couple of rows and then they're empty.

  3. #3
    Ext JS Premium Member Gjslick's Avatar
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    129
    Vote Rating
    6
    Gjslick will become famous soon enough

      0  

    Default


    Hmm, I'm surprised that your grids are even showing a couple of rows. My grids were all just coming up blank. It might be a different problem in your app.

    But what you would do is put the override after you include the Ext files onto your page (after the <script> tags), but before you add the API description to Ext.Direct.addProvider(). I'll update my original post with some instructions actually.

    If you're still having trouble though, post again and I might have a few answers for ya. Been working with this for a little while now :) Otherwise, hope the override helps.

    -Greg

  4. #4
    Ext User
    Join Date
    Dec 2009
    Posts
    22
    Vote Rating
    0
    davidsanderson is on a distinguished road

      0  

    Default


    Yeah, that didn't help. Before the upgrade to 9.0.1, all the json responses were good, now they're coming back with only the first two objects, the rest as strings.
    For example, here is the response I get back from one of my calls:{"success":true,"isCached":false,"dateGenerated":"August, 26 2010 17:34:03","results":"19","retrievalTime":0,"data":[{"description":"","roleId":"17","importance":"0","title":"academicAdministrator"},{"description":"Admin Editor","roleId":"5","importance":"100","title":"ADMIN_EDITOR"},"","","","","","","","","","","","","","","","",""]}

  5. #5
    Ext JS Premium Member Gjslick's Avatar
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    129
    Vote Rating
    6
    Gjslick will become famous soon enough

      0  

    Default


    Ah, yeah, ok, then this override wouldn't have much to do with your particular problem! I was actually going to ask if your responses are still coming back the same. I'm not even sure what would cause just the first two objects to be built and the rest to come back as empty strings...

    How are you creating this data? Are you the using a query or the ORM and serializeJSON()? Is it possible for you to post some code?

  6. #6
    Ext User
    Join Date
    Dec 2009
    Posts
    22
    Vote Rating
    0
    davidsanderson is on a distinguished road

      0  

    Default


    Yes, it's ORM with serializeJSON. I have read a couple of people having problems with that now with 9.0.1. Do you have any idea why? I'll have to post some code tomorrow.

  7. #7
    Ext JS Premium Member Gjslick's Avatar
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    129
    Vote Rating
    6
    Gjslick will become famous soon enough

      0  

    Default


    The only problem that I've really ran into so far is when using inheritance mapping with the ORM. In 9.0.0, using serializeJSON() (or cfdump) would show all of the properties of both the base class, and the subclass, for a particular object. In 9.0.1, they only show the properties of the subclass. I don't know if that would be your problem though, because serializeJSON() should at least still be placing curly braces into the json for all of the objects, instead of just empty strings.

    Are all of the objects that are coming back from the ORM query correct inside of ColdFusion itself? Try cfdump'ing the result of the query or entityLoad, and see if everything is there. I'm wondering if it is a problem with the ORM retrieval of the objects themselves, or a problem with serializeJSON().

    -Greg

  8. #8
    Ext User
    Join Date
    Dec 2009
    Posts
    22
    Vote Rating
    0
    davidsanderson is on a distinguished road

      0  

    Default


    FYI, this hot fix fixed the problem: http://kb2.adobe.com/cps/862/cpsid_86263.html
    Specifically the last bug fix: "serializeJSON incorrectly serializes nested objects."

  9. #9
    Ext JS Premium Member Gjslick's Avatar
    Join Date
    Feb 2009
    Location
    NJ, USA
    Posts
    129
    Vote Rating
    6
    Gjslick will become famous soon enough

      0  

    Default


    Hey, thanks for that update. I didn't even realize that there was a hotfix out now because I actually ended up downgrading back to 9.0.0 because of that numbers->strings issue. And it looks the last bug that was fixed was your problem :) I'll update my original post and add the link. Thanks again.

    -Greg

Similar Threads

  1. Simple Ext.Direct-Combobox plugin --- with Ext.Direct.Store for reuse
    By xp743 in forum Ext 3.x: User Extensions and Plugins
    Replies: 1
    Last Post: 26 Jul 2010, 11:56 AM
  2. populate ext.form.combobox (ext 2.) from an sql database using coldfusion 9
    By sarahmfr in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 25 May 2010, 1:27 PM
  3. Ext JS 3.0 Grid with ColdFusion 8/9
    By kumarshah in forum Community Discussion
    Replies: 4
    Last Post: 20 Jul 2009, 2:26 PM
  4. Ext.Ajax and ColdFusion
    By captdan78 in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 10 Jul 2008, 1:07 PM
  5. Coldfusion & Ext 2.0
    By dawesi in forum Community Discussion
    Replies: 3
    Last Post: 18 Dec 2007, 8:21 AM

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi