Loading ...
Sorry, an error occurred while loading the content.

15964DataSource Models

Expand Messages
  • monsieurdizzy
    Jul 31, 2007
    • 0 Attachment
      Hello, everyone.

      I've been using YUI's DataSource class as a manager for multiple AJAX
      requests in a web environment to which I am contributing. There isn't
      much documentation on this particular corner of the YUI world, but
      this post proved very helpful:

      http://tech.groups.yahoo.com/group/ydn-javascript/message/14270

      My question is with regards to the "model" parameter when sending a
      request. The "model" defines which fields to retrieve from the XML
      response. Up until recently, my XML response has been single-leveled,
      so all I've needed was the name of the root node and an array of the
      various element names.

      Now, however, the rest of the development team has switched to XML
      responses with various layers of nesting, and the example posted
      earlier gives no such example of this.

      Does YUI DataSource support response models with nested elements? If
      so, what would the model look like if I was processing an XML
      structure like this?

      <xmlresponse>
      <fruits>
      <red>apple</red>
      <red>cherry</red>
      <green>watermelon</green>
      <green>lime</green>
      </fruits>
      <vegetables>
      <orange>carrot</orange>
      <orange>pumpkin</orange>
      <purple>eggplant</purple>
      <purple>monkey</purple>
      </vegetables>
      </xmlresponse>

      As an aside, I know DataTable was given a significant revamp, but were
      any of the other additions that were mentioned on this forum included
      in DataSource as intended, such as the ability to make POST requests?

      Thank you very much for your time and consideration.
    • Show all 2 messages in this topic