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

Re: [ydn-javascript] include result node in XML data source fields?

Expand Messages
  • Satyam
    I m afraid you can t do that. The logic DataSource uses is, it first finds all elements with tagname option then, for each field, it will look for each
    Message 1 of 2 , Aug 6, 2009
    • 0 Attachment
      I'm afraid you can't do that. The logic DataSource uses is, it first
      finds all elements with tagname 'option' then, for each field, it will
      look for each field first as an attribute and then it will do a
      getElementsByTagName using 'option' as the root, so it won't find
      itself. Unless there is a way to fool getElementsByTagname to tell it
      to search for itself, or look for anything (since it is the only thing
      remaining, there is nothing else it could find). Perhaps a '.' (dot) or
      '*', but I wouldn't bet much on those.

      Satyam

      Jack Bates escribió:
      > How can I include the result node in XML data source fields?
      >
      > For example, given an HTML <select> element and resultNode = 'option',
      > how can I configure result schema fields for the option and the option
      > value?
      >
      > I tried,
      >
      > var dataSource = new YAHOO.util.LocalDataSource(document.getElementById('select'));
      > dataSource.responseSchema = {
      > fields: ['option', 'value'],
      > resultNode: 'option' };
      > dataSource.responseType = YAHOO.util.DataSourceBase.TYPE_XML;
      >
      > - in which case the 'value' field works but the 'option' field doesn't
      >
      > Here's a test case demonstrating the 'value' field working but the
      > 'option' field not
      >
      > http://www.sfu.ca/~jdbates/tmp/yui/200908050/
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - www.avg.com
      > Version: 8.5.392 / Virus Database: 270.13.44/2283 - Release Date: 08/05/09 05:57:00
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.