Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Mar 2009
    Location
    Switzerland
    Posts
    26
    Vote Rating
    0
    Tewr is on a distinguished road

      0  

    Default [FIXED-2][3.0.0] XmlReader exception event response object undefined

    [FIXED-2][3.0.0] XmlReader exception event response object undefined


    Ext.data.DataProxy-exception documentation is, IMHO, not explicit enough.
    Code:
    * @param {Object} response
             * The value of this parameter depends on the value of the type parameter:
    
             *
    • *
    • 'response' : * The raw browser response object (e.g.: XMLHttpRequest) * *
    • 'remote' : * The decoded response object sent from the server.
    Now what does the text in red mean? If you have a jsonreader, it simply means what it says, and all is fine and well. However, if you are using an out of the box XmlReader, the response object here will just be undefined. So the user has to understand that "decoded" implies that you are using a json reader...

    Suggestion: Change the text to "The response object, decoded using the reader's readResponse() function", or perhaps even more explicit, that the XmlReader does not have such a function, that you have to extend the reader with this (what I did to make it work), or something.

    All this made me feel a bit like a lower being for reading xml rather than json, but it's not by choice...

  2. #2
    Ext User
    Join Date
    Jul 2007
    Location
    Florida
    Posts
    9,996
    Vote Rating
    6
    mjlecomte will become famous soon enough mjlecomte will become famous soon enough

      0  

    Default


    I have moved your post to it's own thread as a bug report.

    At the moment the XmlReader code has a "TODO" identified for readResponse.
    Code:
        // TODO: implement readResponse for XmlReader
        readResponse : Ext.emptyFn
    So technically I think this may fall under a bug more than a documentation issue (and I don't think this falls under feature request as it should be supported already). That is, once the readResponse method is implemented the aforementioned documentation clarification would be moot.

    If you care to post any working test case or code you have implemented because of this matter it may help facilitate resolving the issue.

  3. #3
    Ext User
    Join Date
    Mar 2009
    Location
    Switzerland
    Posts
    26
    Vote Rating
    0
    Tewr is on a distinguished road

      0  

    Default


    oh... I just returned an object that I could use, so it is very simple:

    Code:
    /*
    * Overrides Ext.data.XmlReader
    *
    * additions: readResponse() implementation
    *
    */
    Ext.override(Ext.data.XmlReader, {
        readResponse: function(action, response) {
            return (response.responseXML !== undefined) ? response.responseXML : response;
        }
    });
    .. but it works for the exceptionhandler. The JsonReader implementation does a lot of other stuff like checking for a successproperty and metadata and whatnot, but I didnt feel that was relevant as I only use this function when reading exception data, whereas the Json reader uses this function "all the time". And I dont have a deep knowledge of the Ext.data.Api thingys so I don't know what (if?) tests should be carried out with the action variable.

  4. #4
    Ext JS Premium Member christocracy's Avatar
    Join Date
    Oct 2006
    Location
    Montreal
    Posts
    381
    Vote Rating
    0
    christocracy is on a distinguished road

      0  

    Default


    Hi Tewr. I'm afraid the support for XmlReader / XmlWriter support has languished a bit behind JsonWriter / JsonWriter. I was working on this a few weeks ago but was side-tracked. I'm looking into this now.
    /**
    * @author Chris Scott
    * @business www.transistorsoft.com
    * @rate $150USD / hr; training $500USD / day / developer (5 dev min)
    *
    * @SenchaDevs http://senchadevs.com/developers/transistor-software
    * @twitter http://twitter.com/#!/christocracy
    * @github https://github.com/christocracy
    */

  5. #5
    Ext JS Premium Member christocracy's Avatar
    Join Date
    Oct 2006
    Location
    Montreal
    Posts
    381
    Vote Rating
    0
    christocracy is on a distinguished road

      0  

    Default


    XmlWriter as well as XmlReader#readResponse have been implemented in SVN.

    XmlWriter uses an XTemplate to render XML so should be very flexible.
    /**
    * @author Chris Scott
    * @business www.transistorsoft.com
    * @rate $150USD / hr; training $500USD / day / developer (5 dev min)
    *
    * @SenchaDevs http://senchadevs.com/developers/transistor-software
    * @twitter http://twitter.com/#!/christocracy
    * @github https://github.com/christocracy
    */

Thread Participants: 2