1. #21
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,963
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    Quote Originally Posted by Curtis Fletcher View Post
    So, back to getting a basic working multi-part submit. I'm tempted to scrape your entire multi-part demo and test it on a machine on my side, because if it misbehaves without any changes at all it must be the transfer-encoding that's messing it up, what do you think?
    @Curtis -- Would need to see a full dump of the actual response (headers and all) to even render a guess.
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  2. #22
    Ext JS Premium Member
    Join Date
    Feb 2008
    Location
    SRC solution, Toulouse, FR
    Posts
    18
    Vote Rating
    2
    jfa is on a distinguished road

      0  

    Question empty json response

    empty json response


    Hello, a response (status code 200, content type app/json) returning nothing is treated like an error (due to syntax error thrown by Ext.decode to set responseJSON) and so failure callback is called.
    Is it the expected behaviour ?

  3. #23
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,963
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    Quote Originally Posted by jfa View Post
    Hello, a response (status code 200, content type app/json) returning nothing is treated like an error (due to syntax error thrown by Ext.decode to set responseJSON) and so failure callback is called.
    Is it the expected behaviour ?
    @jfa -- Yes, the working assumption is:

    'if the JSON returned by the server is poorly structured or otherwise cannot be properly decoded -- an exception event is raised and/or the failure callback is invoked'.

    Why would you send back nothing with a Content-type header of application/json (which implies it should be treated as such)?
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  4. #24
    Ext JS Premium Member
    Join Date
    Feb 2008
    Location
    SRC solution, Toulouse, FR
    Posts
    18
    Vote Rating
    2
    jfa is on a distinguished road

      0  

    Default


    Quote Originally Posted by hendricd View Post
    Why would you send back nothing with a Content-type header of application/json (which implies it should be treated as such)?
    Content-type is set by my REST framework, following the process, result can be only a confirmation, or an error report, ...
    I thought an empty string is decoded as null, but strictly, you're right
    Thanks

  5. #25
    Ext JS Premium Member
    Join Date
    Aug 2008
    Posts
    40
    Vote Rating
    0
    jnadler is on a distinguished road

      0  

    Default


    Ext 2.2.1, ext-basex 3.5

    Hi,

    Just trying basex for the first time. (pop!)

    I'm using it (or hoping to) for cross domain calls; I built a JSONP method on my server and did a simple example to prove the concept.

    My callback never gets called. Any suggestions for debugging this?

    Code:
                
         Ext.Ajax.request({
                    url: this.requestUrl,
                    method: this.requestMethod,
                    success: this.handleSuccess,
                    failure: this.handleFailure,
                    headers: headers,
                    params: loginTokenParams,
                    
                    isJSON: true,
                    proxied: {
                        debug: true,
                        callbackParam: 'callback'
                    },
                    callback: function(options, success, response) {
                        alert('the callback was called');
                    },
    
                    scope: this
                });
    When I watch it in firebug it seems to start OK. Basex passes parameter:
    Code:
    callback: basexCallback0
    And the server responds appropriately I think; it is using content type application/x-javascript which seems to be a limitation of Jersey (Java based REST framework):
    Code:
    basexCallback0({"partyId":"3"})
    But no callback ever occurs.

  6. #26
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,963
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    Quote Originally Posted by jnadler View Post
    Ext 2.2.1, ext-basex 3.5

    Hi,

    Just trying basex for the first time. (pop!)

    I'm using it (or hoping to) for cross domain calls; I built a JSONP method on my server and did a simple example to prove the concept.

    My callback never gets called. Any suggestions for debugging this?

    Code:
                
         Ext.Ajax.request({
                    url: this.requestUrl,
                    method: this.requestMethod,
                    success: this.handleSuccess,
                    failure: this.handleFailure,
                    headers: headers,
                    params: loginTokenParams,
                    
                    isJSON: true,
                    proxied: {
                        debug: true,
                        callbackParam: 'callback'
                    },
                    callback: function(options, success, response) {
                        alert('the callback was called');
                    },
    
                    scope: this
                });
    When I watch it in firebug it seems to start OK. Basex passes parameter:
    Code:
    callback: basexCallback0
    And the server responds appropriately I think; it is using content type application/x-javascript which seems to be a limitation of Jersey (Java based REST framework):
    Code:
    basexCallback0({"partyId":"3"})
    But no callback ever occurs.
    See the Flickr Ajax call on this demo page.
    (And, download the latest zip again. it was updated just moments ago.)
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  7. #27
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    there's something funky with the Ext.clone() method from ext-basex SVN rev. 58.

    try this:
    Code:
    a = Ext.clone({ 
        myFn: function() {
            return 'woohoo!';
        } 
    }, true); // true to perform a deep clone
    then log the contents of a in Firebug.
    you'll see that myFn has been mysteriously transformed from a Function into an Object.


    [edit]
    workaround:
    deep cloning starts to work correctly if Ext.clone() has been invoked at least once.
    i.e.
    Code:
    Ext.clone(); // invoke Ext.clone() once
    
    a = Ext.clone({ 
        myFn: function() {
            return 'woohoo!';
        } 
    }, true); // true to perform a deep clone

  8. #28
    Ext JS Premium Member
    Join Date
    Aug 2008
    Posts
    40
    Vote Rating
    0
    jnadler is on a distinguished road

      0  

    Default


    I wasn't able to get it working with ext-basex 3.5, but 3.4 is working fine with the original code I posted.

    I'm still in the dark ages of ExtJS 2.2.1 if that explains anything.

  9. #29
    Sencha - Community Support Team hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,963
    Vote Rating
    10
    hendricd will become famous soon enough hendricd will become famous soon enough

      0  

    Default


    Quote Originally Posted by jnadler View Post
    I wasn't able to get it working with ext-basex 3.5, but 3.4 is working fine with the original code I posted.

    I'm still in the dark ages of ExtJS 2.2.1 if that explains anything.
    Thanks, I'm tweaking Ext.clone as we speak, so I'll take a look at that too.
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  10. #30
    Ext JS Premium Member
    Join Date
    Aug 2008
    Posts
    40
    Vote Rating
    0
    jnadler is on a distinguished road

      0  

    Default


    One more issue: I pass an array of request headers, this was working as expected with plain Ext.lib.Ajax.

    With ext-basex my headers are not included in the request. This one isn't a proxied request.