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

Re: autocomplete issues

Expand Messages
  • tomashelikar
    ... library. ... right, ... source ... {position:absolute;margin:.3em;width:100%;background:#a0a0a0;z-index:9049;} ... Search ... id= searchinput / ...
    Message 1 of 11 , Apr 2 8:03 AM
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@...>
      wrote:
      >
      > --- In ydn-javascript@yahoogroups.com, "bdetarade"
      > <benoit.de.tarade@> wrote:
      > >
      > > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
      > > wrote:
      > > >
      > > > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
      > > > wrote:
      > > > >
      > > > > Hi,
      > > > Anybody any ideas? Please?
      > > >
      > > > > This is my first post on this forum. I just started using the
      > YUI, and
      > > > > must say that it is absolutely amazing what you guys have
      > > accomplished!
      > > > >
      > > > > Since I am new to using the YUI, this might be a trivial issue
      > that I
      > > > > didn't see due to the short amount of time I've using your
      library.
      > > > >
      > > > > I've spent last several days to get the autocomplete working
      right,
      > > > > however, with no luck. I am using the XML version of the data
      source
      > > > > object. The problem is that autocomplete returns only the first
      > > > > element in the xml file. You can see its behaviour at:
      > > > > www.imouse.gsbrno.cz/autocomplete.php
      > > > >
      > > > > Any help/suggestion are greatly appreciated.
      > > > >
      > > > > Thanks a lot,
      > > > > Tom
      > > > >
      > > >
      > >
      > >
      > > Can you send use a non condensed version of your js code.
      > >
      >
      > It should be non condensed when you view source page - at least it is
      > on my browser. But here's the code anyways. Thanks again.
      >
      > <html>
      > <head>
      > <title>Example: AutoComplete - Basic XML Data (YUI Library)</title>
      > <style type="text/css">
      > #ysearchmod {position:relative;padding:1em;}
      > #ysearchautocomplete {position:relative;margin:1em;width:40%;}/*
      > set width of widget here*/
      > #ysearchinput {position:absolute;width:100%;height:1.4em;}
      > #ysearchcontainer {position:absolute;top:1.7em;width:100%;}
      > #ysearchcontainer .yui-ac-content
      > {position:absolute;width:100%;border:1px solid
      > #404040;background:#fff;overflow:hidden;z-index:9050;}
      > #ysearchcontainer .yui-ac-shadow
      >
      {position:absolute;margin:.3em;width:100%;background:#a0a0a0;z-index:9049;}
      > #ysearchcontainer ul {padding:5px 0;width:100%;}
      > #ysearchcontainer li {padding:0
      > 5px;cursor:default;white-space:nowrap;}
      > #ysearchcontainer li.yui-ac-highlight {background:#ff0;}
      > </style>
      > </head>
      > <body>
      > <div id="bd">
      > <!-- AutoComplete begins -->
      > <div id="ysearchmod">
      >
      > <form onsubmit="return false">
      > <h2 onclick="alert(oAutoComp.toString());">Yahoo!
      Search</h2>
      > <div id="ysearchautocomplete">
      > <input id="ysearchinput">
      > <div id="ysearchcontainer"></div>
      > </div>
      > </form>
      > </div>
      >
      > </div>
      > <!-- AutoComplete ends -->
      > <!-- form onsubmit="return false">
      > <p>Search autocomplete:
      > <div id="propertysearch">
      > <input autocomplete="off"
      id="searchinput" />
      > <div id="searchresults">
      >  
      > </div>
      > </div>
      > </form -->
      > </body>
      > </html>
      > <!-- Dependencies -->
      > <script type="text/javascript"
      >
      src="http://yui.yahooapis.com/2.2.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
      >
      >
      > <!-- OPTIONAL: Connection (required only if using XHR DataSource) -->
      > <script type="text/javascript"
      >
      src="http://yui.yahooapis.com/2.2.0/build/connection/connection-min.js"></script>
      >
      >
      > <!-- OPTIONAL: Animation (required only if enabling animation) -->
      > <script type="text/javascript"
      >
      src="http://yui.yahooapis.com/2.2.0/build/animation/animation-min.js"></script>
      >
      >
      > <!-- OPTIONAL: External JSON parser from http://www.json.org/
      > (enables JSON validation) -->
      > <script type="text/javascript"
      > src="http://www.json.org/json.js"></script>
      >
      > <!-- Source file -->
      > <script type="text/javascript"
      >
      src="http://yui.yahooapis.com/2.2.0/build/autocomplete/autocomplete-min.js"></script>
      >
      > <script type="text/javascript">
      > // Instantiate an XHR DataSource and define schema as an
      > array:
      > //
      > ["Multi-depth.object.notation.to.find.a.single.result.item",
      > // "Query Key",
      > // "Additional Param Name 1",
      > // ...
      > // "Additional Param Name n"]
      > oACDS = new YAHOO.widget.DS_XHR("./example.xml",
      > ["person", "name"]);
      > //alert(oACDS.toString());
      > oACDS.responseType = YAHOO.widget.DS_XHR.TYPE_XML;
      > oACDS.queryMatchContains = true;
      > /*oACDS.scriptQueryAppend = "results=100"; // Needed for
      YWS*/
      >
      > // Instantiate AutoComplete
      > oAutoComp = new
      > YAHOO.widget.AutoComplete("ysearchinput","ysearchcontainer", oACDS);
      > </script>
      >

      Any ideas on this please?
    • bdetarade
      Have you tried to retrieve xml data from url http://developer.yahoo.com/yui/examples/autocomplete/php/ysearch_proxy.php to check the format of you
      Message 2 of 11 , Apr 3 3:23 PM
      • 0 Attachment
        Have you tried to retrieve xml data from url
        "http://developer.yahoo.com/yui/examples/autocomplete/php/ysearch_proxy.php"
        to check the format of you example.xml file?

        --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@...>
        wrote:
        >
        > --- In ydn-javascript@yahoogroups.com, "bdetarade"
        > <benoit.de.tarade@> wrote:
        > >
        > > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
        > > wrote:
        > > >
        > > > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
        > > > wrote:
        > > > >
        > > > > Hi,
        > > > Anybody any ideas? Please?
        > > >
        > > > > This is my first post on this forum. I just started using the
        > YUI, and
        > > > > must say that it is absolutely amazing what you guys have
        > > accomplished!
        > > > >
        > > > > Since I am new to using the YUI, this might be a trivial issue
        > that I
        > > > > didn't see due to the short amount of time I've using your
        library.
        > > > >
        > > > > I've spent last several days to get the autocomplete working
        right,
        > > > > however, with no luck. I am using the XML version of the data
        source
        > > > > object. The problem is that autocomplete returns only the first
        > > > > element in the xml file. You can see its behaviour at:
        > > > > www.imouse.gsbrno.cz/autocomplete.php
        > > > >
        > > > > Any help/suggestion are greatly appreciated.
        > > > >
        > > > > Thanks a lot,
        > > > > Tom
        > > > >
        > > >
        > >
        > >
        > > Can you send use a non condensed version of your js code.
        > >
        >
        > It should be non condensed when you view source page - at least it is
        > on my browser. But here's the code anyways. Thanks again.
        >
        > <html>
        > <head>
        > <title>Example: AutoComplete - Basic XML Data (YUI Library)</title>
        > <style type="text/css">
        > #ysearchmod {position:relative;padding:1em;}
        > #ysearchautocomplete {position:relative;margin:1em;width:40%;}/*
        > set width of widget here*/
        > #ysearchinput {position:absolute;width:100%;height:1.4em;}
        > #ysearchcontainer {position:absolute;top:1.7em;width:100%;}
        > #ysearchcontainer .yui-ac-content
        > {position:absolute;width:100%;border:1px solid
        > #404040;background:#fff;overflow:hidden;z-index:9050;}
        > #ysearchcontainer .yui-ac-shadow
        >
        {position:absolute;margin:.3em;width:100%;background:#a0a0a0;z-index:9049;}
        > #ysearchcontainer ul {padding:5px 0;width:100%;}
        > #ysearchcontainer li {padding:0
        > 5px;cursor:default;white-space:nowrap;}
        > #ysearchcontainer li.yui-ac-highlight {background:#ff0;}
        > </style>
        > </head>
        > <body>
        > <div id="bd">
        > <!-- AutoComplete begins -->
        > <div id="ysearchmod">
        >
        > <form onsubmit="return false">
        > <h2 onclick="alert(oAutoComp.toString());">Yahoo!
        Search</h2>
        > <div id="ysearchautocomplete">
        > <input id="ysearchinput">
        > <div id="ysearchcontainer"></div>
        > </div>
        > </form>
        > </div>
        >
        > </div>
        > <!-- AutoComplete ends -->
        > <!-- form onsubmit="return false">
        > <p>Search autocomplete:
        > <div id="propertysearch">
        > <input autocomplete="off"
        id="searchinput" />
        > <div id="searchresults">
        >  
        > </div>
        > </div>
        > </form -->
        > </body>
        > </html>
        > <!-- Dependencies -->
        > <script type="text/javascript"
        >
        src="http://yui.yahooapis.com/2.2.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
        >
        >
        > <!-- OPTIONAL: Connection (required only if using XHR DataSource) -->
        > <script type="text/javascript"
        >
        src="http://yui.yahooapis.com/2.2.0/build/connection/connection-min.js"></script>
        >
        >
        > <!-- OPTIONAL: Animation (required only if enabling animation) -->
        > <script type="text/javascript"
        >
        src="http://yui.yahooapis.com/2.2.0/build/animation/animation-min.js"></script>
        >
        >
        > <!-- OPTIONAL: External JSON parser from http://www.json.org/
        > (enables JSON validation) -->
        > <script type="text/javascript"
        > src="http://www.json.org/json.js"></script>
        >
        > <!-- Source file -->
        > <script type="text/javascript"
        >
        src="http://yui.yahooapis.com/2.2.0/build/autocomplete/autocomplete-min.js"></script>
        >
        > <script type="text/javascript">
        > // Instantiate an XHR DataSource and define schema as an
        > array:
        > //
        > ["Multi-depth.object.notation.to.find.a.single.result.item",
        > // "Query Key",
        > // "Additional Param Name 1",
        > // ...
        > // "Additional Param Name n"]
        > oACDS = new YAHOO.widget.DS_XHR("./example.xml",
        > ["person", "name"]);
        > //alert(oACDS.toString());
        > oACDS.responseType = YAHOO.widget.DS_XHR.TYPE_XML;
        > oACDS.queryMatchContains = true;
        > /*oACDS.scriptQueryAppend = "results=100"; // Needed for
        YWS*/
        >
        > // Instantiate AutoComplete
        > oAutoComp = new
        > YAHOO.widget.AutoComplete("ysearchinput","ysearchcontainer", oACDS);
        > </script>
        >
      • tomashelikar
        I am not sure if I understand what you mean. My XML file (example.xml) looks like follows: Text1 Text2 Text3
        Message 3 of 11 , Apr 3 8:26 PM
        • 0 Attachment
          I am not sure if I understand what you mean. My XML file (example.xml)
          looks like follows:

          <person>
          <name>Text1</name>
          <name>Text2</name>
          <name>Text3</name>
          <name>Text4</name>
          </person>

          As far as I can tell, it looks like there is no problem with the format.

          Tom
          --- In ydn-javascript@yahoogroups.com, "bdetarade"
          <benoit.de.tarade@...> wrote:
          >
          > Have you tried to retrieve xml data from url
          >
          "http://developer.yahoo.com/yui/examples/autocomplete/php/ysearch_proxy.php"
          > to check the format of you example.xml file?
          >
          > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
          > wrote:
          > >
          > > --- In ydn-javascript@yahoogroups.com, "bdetarade"
          > > <benoit.de.tarade@> wrote:
          > > >
          > > > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
          > > > wrote:
          > > > >
          > > > > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
          > > > > wrote:
          > > > > >
          > > > > > Hi,
          > > > > Anybody any ideas? Please?
          > > > >
          > > > > > This is my first post on this forum. I just started using the
          > > YUI, and
          > > > > > must say that it is absolutely amazing what you guys have
          > > > accomplished!
          > > > > >
          > > > > > Since I am new to using the YUI, this might be a trivial issue
          > > that I
          > > > > > didn't see due to the short amount of time I've using your
          > library.
          > > > > >
          > > > > > I've spent last several days to get the autocomplete working
          > right,
          > > > > > however, with no luck. I am using the XML version of the data
          > source
          > > > > > object. The problem is that autocomplete returns only the first
          > > > > > element in the xml file. You can see its behaviour at:
          > > > > > www.imouse.gsbrno.cz/autocomplete.php
          > > > > >
          > > > > > Any help/suggestion are greatly appreciated.
          > > > > >
          > > > > > Thanks a lot,
          > > > > > Tom
          > > > > >
          > > > >
          > > >
          > > >
          > > > Can you send use a non condensed version of your js code.
          > > >
          > >
          > > It should be non condensed when you view source page - at least it is
          > > on my browser. But here's the code anyways. Thanks again.
          > >
          > > <html>
          > > <head>
          > > <title>Example: AutoComplete - Basic XML Data (YUI Library)</title>
          > > <style type="text/css">
          > > #ysearchmod {position:relative;padding:1em;}
          > > #ysearchautocomplete {position:relative;margin:1em;width:40%;}/*
          > > set width of widget here*/
          > > #ysearchinput {position:absolute;width:100%;height:1.4em;}
          > > #ysearchcontainer {position:absolute;top:1.7em;width:100%;}
          > > #ysearchcontainer .yui-ac-content
          > > {position:absolute;width:100%;border:1px solid
          > > #404040;background:#fff;overflow:hidden;z-index:9050;}
          > > #ysearchcontainer .yui-ac-shadow
          > >
          >
          {position:absolute;margin:.3em;width:100%;background:#a0a0a0;z-index:9049;}
          > > #ysearchcontainer ul {padding:5px 0;width:100%;}
          > > #ysearchcontainer li {padding:0
          > > 5px;cursor:default;white-space:nowrap;}
          > > #ysearchcontainer li.yui-ac-highlight {background:#ff0;}
          > > </style>
          > > </head>
          > > <body>
          > > <div id="bd">
          > > <!-- AutoComplete begins -->
          > > <div id="ysearchmod">
          > >
          > > <form onsubmit="return false">
          > > <h2 onclick="alert(oAutoComp.toString());">Yahoo!
          > Search</h2>
          > > <div id="ysearchautocomplete">
          > > <input id="ysearchinput">
          > > <div id="ysearchcontainer"></div>
          > > </div>
          > > </form>
          > > </div>
          > >
          > > </div>
          > > <!-- AutoComplete ends -->
          > > <!-- form onsubmit="return false">
          > > <p>Search autocomplete:
          > > <div id="propertysearch">
          > > <input autocomplete="off"
          > id="searchinput" />
          > > <div id="searchresults">
          > >  
          > > </div>
          > > </div>
          > > </form -->
          > > </body>
          > > </html>
          > > <!-- Dependencies -->
          > > <script type="text/javascript"
          > >
          >
          src="http://yui.yahooapis.com/2.2.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
          > >
          > >
          > > <!-- OPTIONAL: Connection (required only if using XHR DataSource)
          -->
          > > <script type="text/javascript"
          > >
          >
          src="http://yui.yahooapis.com/2.2.0/build/connection/connection-min.js"></script>
          > >
          > >
          > > <!-- OPTIONAL: Animation (required only if enabling animation) -->
          > > <script type="text/javascript"
          > >
          >
          src="http://yui.yahooapis.com/2.2.0/build/animation/animation-min.js"></script>
          > >
          > >
          > > <!-- OPTIONAL: External JSON parser from http://www.json.org/
          > > (enables JSON validation) -->
          > > <script type="text/javascript"
          > > src="http://www.json.org/json.js"></script>
          > >
          > > <!-- Source file -->
          > > <script type="text/javascript"
          > >
          >
          src="http://yui.yahooapis.com/2.2.0/build/autocomplete/autocomplete-min.js"></script>
          > >
          > > <script type="text/javascript">
          > > // Instantiate an XHR DataSource and define schema as an
          > > array:
          > > //
          > > ["Multi-depth.object.notation.to.find.a.single.result.item",
          > > // "Query Key",
          > > // "Additional Param Name 1",
          > > // ...
          > > // "Additional Param Name n"]
          > > oACDS = new YAHOO.widget.DS_XHR("./example.xml",
          > > ["person", "name"]);
          > > //alert(oACDS.toString());
          > > oACDS.responseType = YAHOO.widget.DS_XHR.TYPE_XML;
          > > oACDS.queryMatchContains = true;
          > > /*oACDS.scriptQueryAppend = "results=100"; // Needed for
          > YWS*/
          > >
          > > // Instantiate AutoComplete
          > > oAutoComp = new
          > > YAHOO.widget.AutoComplete("ysearchinput","ysearchcontainer", oACDS);
          > > </script>
          > >
          >
        • jennykhan
          Hi Tom, Your schema and data are out of sync. You ve defined your schema as: [ person , name ] which is to say, each result is in a node called person , and
          Message 4 of 11 , Apr 9 4:06 PM
          • 0 Attachment
            Hi Tom,

            Your schema and data are out of sync. You've defined your schema as:

            ["person", "name"]

            which is to say, each result is in a node called "person", and within
            each person node look for the data value "name".

            Your return data contains one node "person", thus your container
            populates with only one result.

            There are many ways to solve your problem, but at the root of it, just
            make sure the schema you define is accurate for the data you are
            working with. For instance, try returning the following XML, and I
            think your problem should be solved:

            <person>
            <name param="1">aText1</name>
            </person>
            <person>
            <name param="2">bText2</name>
            </person>
            <person>
            <name param="3">cText3</name>
            </person>
            <person>
            <name param="4">dText4</name>
            </person>

            Hope that helps,
            Jenny


            --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@...>
            wrote:
            >
            > I am not sure if I understand what you mean. My XML file (example.xml)
            > looks like follows:
            >
            > <person>
            > <name>Text1</name>
            > <name>Text2</name>
            > <name>Text3</name>
            > <name>Text4</name>
            > </person>
            >
            > As far as I can tell, it looks like there is no problem with the
            format.
            >
            > Tom
            > --- In ydn-javascript@yahoogroups.com, "bdetarade"
            > <benoit.de.tarade@> wrote:
            > >
            > > Have you tried to retrieve xml data from url
            > >
            >
            "http://developer.yahoo.com/yui/examples/autocomplete/php/ysearch_proxy.php"
            > > to check the format of you example.xml file?
            > >
            > > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
            > > wrote:
            > > >
            > > > --- In ydn-javascript@yahoogroups.com, "bdetarade"
            > > > <benoit.de.tarade@> wrote:
            > > > >
            > > > > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
            > > > > wrote:
            > > > > >
            > > > > > --- In ydn-javascript@yahoogroups.com, "tomashelikar"
            <helikart@>
            > > > > > wrote:
            > > > > > >
            > > > > > > Hi,
            > > > > > Anybody any ideas? Please?
            > > > > >
            > > > > > > This is my first post on this forum. I just started using the
            > > > YUI, and
            > > > > > > must say that it is absolutely amazing what you guys have
            > > > > accomplished!
            > > > > > >
            > > > > > > Since I am new to using the YUI, this might be a trivial issue
            > > > that I
            > > > > > > didn't see due to the short amount of time I've using your
            > > library.
            > > > > > >
            > > > > > > I've spent last several days to get the autocomplete working
            > > right,
            > > > > > > however, with no luck. I am using the XML version of the data
            > > source
            > > > > > > object. The problem is that autocomplete returns only the
            first
            > > > > > > element in the xml file. You can see its behaviour at:
            > > > > > > www.imouse.gsbrno.cz/autocomplete.php
            > > > > > >
            > > > > > > Any help/suggestion are greatly appreciated.
            > > > > > >
            > > > > > > Thanks a lot,
            > > > > > > Tom
            > > > > > >
            > > > > >
            > > > >
            > > > >
            > > > > Can you send use a non condensed version of your js code.
            > > > >
            > > >
            > > > It should be non condensed when you view source page - at least
            it is
            > > > on my browser. But here's the code anyways. Thanks again.
            > > >
            > > > <html>
            > > > <head>
            > > > <title>Example: AutoComplete - Basic XML Data (YUI Library)</title>
            > > > <style type="text/css">
            > > > #ysearchmod {position:relative;padding:1em;}
            > > > #ysearchautocomplete {position:relative;margin:1em;width:40%;}/*
            > > > set width of widget here*/
            > > > #ysearchinput {position:absolute;width:100%;height:1.4em;}
            > > > #ysearchcontainer {position:absolute;top:1.7em;width:100%;}
            > > > #ysearchcontainer .yui-ac-content
            > > > {position:absolute;width:100%;border:1px solid
            > > > #404040;background:#fff;overflow:hidden;z-index:9050;}
            > > > #ysearchcontainer .yui-ac-shadow
            > > >
            > >
            >
            {position:absolute;margin:.3em;width:100%;background:#a0a0a0;z-index:9049;}
            > > > #ysearchcontainer ul {padding:5px 0;width:100%;}
            > > > #ysearchcontainer li {padding:0
            > > > 5px;cursor:default;white-space:nowrap;}
            > > > #ysearchcontainer li.yui-ac-highlight {background:#ff0;}
            > > > </style>
            > > > </head>
            > > > <body>
            > > > <div id="bd">
            > > > <!-- AutoComplete begins -->
            > > > <div id="ysearchmod">
            > > >
            > > > <form onsubmit="return false">
            > > > <h2 onclick="alert(oAutoComp.toString());">Yahoo!
            > > Search</h2>
            > > > <div id="ysearchautocomplete">
            > > > <input id="ysearchinput">
            > > > <div id="ysearchcontainer"></div>
            > > > </div>
            > > > </form>
            > > > </div>
            > > >
            > > > </div>
            > > > <!-- AutoComplete ends -->
            > > > <!-- form onsubmit="return false">
            > > > <p>Search autocomplete:
            > > > <div id="propertysearch">
            > > > <input autocomplete="off"
            > > id="searchinput" />
            > > > <div id="searchresults">
            > > >  
            > > > </div>
            > > > </div>
            > > > </form -->
            > > > </body>
            > > > </html>
            > > > <!-- Dependencies -->
            > > > <script type="text/javascript"
            > > >
            > >
            >
            src="http://yui.yahooapis.com/2.2.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
            > > >
            > > >
            > > > <!-- OPTIONAL: Connection (required only if using XHR DataSource)
            > -->
            > > > <script type="text/javascript"
            > > >
            > >
            >
            src="http://yui.yahooapis.com/2.2.0/build/connection/connection-min.js"></script>
            > > >
            > > >
            > > > <!-- OPTIONAL: Animation (required only if enabling animation) -->
            > > > <script type="text/javascript"
            > > >
            > >
            >
            src="http://yui.yahooapis.com/2.2.0/build/animation/animation-min.js"></script>
            > > >
            > > >
            > > > <!-- OPTIONAL: External JSON parser from http://www.json.org/
            > > > (enables JSON validation) -->
            > > > <script type="text/javascript"
            > > > src="http://www.json.org/json.js"></script>
            > > >
            > > > <!-- Source file -->
            > > > <script type="text/javascript"
            > > >
            > >
            >
            src="http://yui.yahooapis.com/2.2.0/build/autocomplete/autocomplete-min.js"></script>
            > > >
            > > > <script type="text/javascript">
            > > > // Instantiate an XHR DataSource and define schema as an
            > > > array:
            > > > //
            > > > ["Multi-depth.object.notation.to.find.a.single.result.item",
            > > > // "Query Key",
            > > > // "Additional Param Name 1",
            > > > // ...
            > > > // "Additional Param Name n"]
            > > > oACDS = new YAHOO.widget.DS_XHR("./example.xml",
            > > > ["person", "name"]);
            > > > //alert(oACDS.toString());
            > > > oACDS.responseType = YAHOO.widget.DS_XHR.TYPE_XML;
            > > > oACDS.queryMatchContains = true;
            > > > /*oACDS.scriptQueryAppend = "results=100"; // Needed for
            > > YWS*/
            > > >
            > > > // Instantiate AutoComplete
            > > > oAutoComp = new
            > > > YAHOO.widget.AutoComplete("ysearchinput","ysearchcontainer", oACDS);
            > > > </script>
            > > >
            > >
            >
          • tomashelikar
            Jenny, you are my savior! Thanks a lot for your help! Tom ... http://developer.yahoo.com/yui/examples/autocomplete/php/ysearch_proxy.php ... ...
            Message 5 of 11 , Apr 9 5:37 PM
            • 0 Attachment
              Jenny, you are my savior! Thanks a lot for your help!

              Tom

              --- In ydn-javascript@yahoogroups.com, "jennykhan" <jennyhan@...> wrote:
              >
              > Hi Tom,
              >
              > Your schema and data are out of sync. You've defined your schema as:
              >
              > ["person", "name"]
              >
              > which is to say, each result is in a node called "person", and within
              > each person node look for the data value "name".
              >
              > Your return data contains one node "person", thus your container
              > populates with only one result.
              >
              > There are many ways to solve your problem, but at the root of it, just
              > make sure the schema you define is accurate for the data you are
              > working with. For instance, try returning the following XML, and I
              > think your problem should be solved:
              >
              > <person>
              > <name param="1">aText1</name>
              > </person>
              > <person>
              > <name param="2">bText2</name>
              > </person>
              > <person>
              > <name param="3">cText3</name>
              > </person>
              > <person>
              > <name param="4">dText4</name>
              > </person>
              >
              > Hope that helps,
              > Jenny
              >
              >
              > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
              > wrote:
              > >
              > > I am not sure if I understand what you mean. My XML file (example.xml)
              > > looks like follows:
              > >
              > > <person>
              > > <name>Text1</name>
              > > <name>Text2</name>
              > > <name>Text3</name>
              > > <name>Text4</name>
              > > </person>
              > >
              > > As far as I can tell, it looks like there is no problem with the
              > format.
              > >
              > > Tom
              > > --- In ydn-javascript@yahoogroups.com, "bdetarade"
              > > <benoit.de.tarade@> wrote:
              > > >
              > > > Have you tried to retrieve xml data from url
              > > >
              > >
              >
              "http://developer.yahoo.com/yui/examples/autocomplete/php/ysearch_proxy.php"
              > > > to check the format of you example.xml file?
              > > >
              > > > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
              > > > wrote:
              > > > >
              > > > > --- In ydn-javascript@yahoogroups.com, "bdetarade"
              > > > > <benoit.de.tarade@> wrote:
              > > > > >
              > > > > > --- In ydn-javascript@yahoogroups.com, "tomashelikar"
              <helikart@>
              > > > > > wrote:
              > > > > > >
              > > > > > > --- In ydn-javascript@yahoogroups.com, "tomashelikar"
              > <helikart@>
              > > > > > > wrote:
              > > > > > > >
              > > > > > > > Hi,
              > > > > > > Anybody any ideas? Please?
              > > > > > >
              > > > > > > > This is my first post on this forum. I just started
              using the
              > > > > YUI, and
              > > > > > > > must say that it is absolutely amazing what you guys have
              > > > > > accomplished!
              > > > > > > >
              > > > > > > > Since I am new to using the YUI, this might be a trivial
              issue
              > > > > that I
              > > > > > > > didn't see due to the short amount of time I've using your
              > > > library.
              > > > > > > >
              > > > > > > > I've spent last several days to get the autocomplete working
              > > > right,
              > > > > > > > however, with no luck. I am using the XML version of the
              data
              > > > source
              > > > > > > > object. The problem is that autocomplete returns only the
              > first
              > > > > > > > element in the xml file. You can see its behaviour at:
              > > > > > > > www.imouse.gsbrno.cz/autocomplete.php
              > > > > > > >
              > > > > > > > Any help/suggestion are greatly appreciated.
              > > > > > > >
              > > > > > > > Thanks a lot,
              > > > > > > > Tom
              > > > > > > >
              > > > > > >
              > > > > >
              > > > > >
              > > > > > Can you send use a non condensed version of your js code.
              > > > > >
              > > > >
              > > > > It should be non condensed when you view source page - at least
              > it is
              > > > > on my browser. But here's the code anyways. Thanks again.
              > > > >
              > > > > <html>
              > > > > <head>
              > > > > <title>Example: AutoComplete - Basic XML Data (YUI
              Library)</title>
              > > > > <style type="text/css">
              > > > > #ysearchmod {position:relative;padding:1em;}
              > > > > #ysearchautocomplete
              {position:relative;margin:1em;width:40%;}/*
              > > > > set width of widget here*/
              > > > > #ysearchinput {position:absolute;width:100%;height:1.4em;}
              > > > > #ysearchcontainer {position:absolute;top:1.7em;width:100%;}
              > > > > #ysearchcontainer .yui-ac-content
              > > > > {position:absolute;width:100%;border:1px solid
              > > > > #404040;background:#fff;overflow:hidden;z-index:9050;}
              > > > > #ysearchcontainer .yui-ac-shadow
              > > > >
              > > >
              > >
              >
              {position:absolute;margin:.3em;width:100%;background:#a0a0a0;z-index:9049;}
              > > > > #ysearchcontainer ul {padding:5px 0;width:100%;}
              > > > > #ysearchcontainer li {padding:0
              > > > > 5px;cursor:default;white-space:nowrap;}
              > > > > #ysearchcontainer li.yui-ac-highlight {background:#ff0;}
              > > > > </style>
              > > > > </head>
              > > > > <body>
              > > > > <div id="bd">
              > > > > <!-- AutoComplete begins -->
              > > > > <div id="ysearchmod">
              > > > >
              > > > > <form onsubmit="return false">
              > > > > <h2 onclick="alert(oAutoComp.toString());">Yahoo!
              > > > Search</h2>
              > > > > <div id="ysearchautocomplete">
              > > > > <input id="ysearchinput">
              > > > > <div id="ysearchcontainer"></div>
              > > > > </div>
              > > > > </form>
              > > > > </div>
              > > > >
              > > > > </div>
              > > > > <!-- AutoComplete ends -->
              > > > > <!-- form onsubmit="return false">
              > > > > <p>Search autocomplete:
              > > > > <div id="propertysearch">
              > > > > <input autocomplete="off"
              > > > id="searchinput" />
              > > > > <div id="searchresults">
              > > > >  
              > > > > </div>
              > > > > </div>
              > > > > </form -->
              > > > > </body>
              > > > > </html>
              > > > > <!-- Dependencies -->
              > > > > <script type="text/javascript"
              > > > >
              > > >
              > >
              >
              src="http://yui.yahooapis.com/2.2.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
              > > > >
              > > > >
              > > > > <!-- OPTIONAL: Connection (required only if using XHR DataSource)
              > > -->
              > > > > <script type="text/javascript"
              > > > >
              > > >
              > >
              >
              src="http://yui.yahooapis.com/2.2.0/build/connection/connection-min.js"></script>
              > > > >
              > > > >
              > > > > <!-- OPTIONAL: Animation (required only if enabling
              animation) -->
              > > > > <script type="text/javascript"
              > > > >
              > > >
              > >
              >
              src="http://yui.yahooapis.com/2.2.0/build/animation/animation-min.js"></script>
              > > > >
              > > > >
              > > > > <!-- OPTIONAL: External JSON parser from http://www.json.org/
              > > > > (enables JSON validation) -->
              > > > > <script type="text/javascript"
              > > > > src="http://www.json.org/json.js"></script>
              > > > >
              > > > > <!-- Source file -->
              > > > > <script type="text/javascript"
              > > > >
              > > >
              > >
              >
              src="http://yui.yahooapis.com/2.2.0/build/autocomplete/autocomplete-min.js"></script>
              > > > >
              > > > > <script type="text/javascript">
              > > > > // Instantiate an XHR DataSource and define schema
              as an
              > > > > array:
              > > > > //
              > > > > ["Multi-depth.object.notation.to.find.a.single.result.item",
              > > > > // "Query Key",
              > > > > // "Additional Param Name 1",
              > > > > // ...
              > > > > // "Additional Param Name n"]
              > > > > oACDS = new YAHOO.widget.DS_XHR("./example.xml",
              > > > > ["person", "name"]);
              > > > > //alert(oACDS.toString());
              > > > > oACDS.responseType = YAHOO.widget.DS_XHR.TYPE_XML;
              > > > > oACDS.queryMatchContains = true;
              > > > > /*oACDS.scriptQueryAppend = "results=100"; //
              Needed for
              > > > YWS*/
              > > > >
              > > > > // Instantiate AutoComplete
              > > > > oAutoComp = new
              > > > > YAHOO.widget.AutoComplete("ysearchinput","ysearchcontainer",
              oACDS);
              > > > > </script>
              > > > >
              > > >
              > >
              >
            • Edwin Goei
              ... Is there a way to solve this problem by fixing the schema rather than the XML data? I have data in the original format and want a schema that will work
              Message 6 of 11 , Apr 28 1:12 AM
              • 0 Attachment
                --- In ydn-javascript@yahoogroups.com, "jennykhan" <jennyhan@...> wrote:
                >
                > Hi Tom,
                >
                > Your schema and data are out of sync. You've defined your schema as:
                >
                > ["person", "name"]
                >
                > which is to say, each result is in a node called "person", and within
                > each person node look for the data value "name".
                >
                > Your return data contains one node "person", thus your container
                > populates with only one result.
                >
                > There are many ways to solve your problem, but at the root of it, just
                > make sure the schema you define is accurate for the data you are
                > working with. For instance, try returning the following XML, and I
                > think your problem should be solved:
                >
                > <person>
                > <name param="1">aText1</name>
                > </person>
                > <person>
                > <name param="2">bText2</name>
                > </person>
                > <person>
                > <name param="3">cText3</name>
                > </person>
                > <person>
                > <name param="4">dText4</name>
                > </person>
                >
                > Hope that helps,
                > Jenny
                >
                >
                > --- In ydn-javascript@yahoogroups.com, "tomashelikar" <helikart@>
                > wrote:
                > >
                > > I am not sure if I understand what you mean. My XML file (example.xml)
                > > looks like follows:
                > >
                > > <person>
                > > <name>Text1</name>
                > > <name>Text2</name>
                > > <name>Text3</name>
                > > <name>Text4</name>
                > > </person>

                Is there a way to solve this problem by fixing the schema rather than
                the XML data? I have data in the original format and want a schema
                that will work with it. I tried [ "name", "." ] and [ "name", "/" ]
                but neither works. What schema will work?

                -Edwin
              Your message has been successfully submitted and would be delivered to recipients shortly.