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

Re: Autocomplete multiple results

Expand Messages
  • jennykhan
    Hi Florent, Your handler s argument signature should look like this: var myHandler = function(type, args) { var args[0] = myAutoComp; var args[1] = listItem;
    Message 1 of 4 , Dec 28, 2006
      Hi Florent,

      Your handler's argument signature should look like this:

      var myHandler = function(type, args) {
      var args[0] = myAutoComp;
      var args[1] = listItem;
      var args[2] = dataArray;
      };


      Hope that helps!
      Jenny





      --- In ydn-javascript@yahoogroups.com, "fmassiera" <fmassiera@...> wrote:
      >
      > Hi Jenny,
      >
      > Thks a lot, no more errors.
      > BUT, I don't have anything in my dataArray (->"null").
      > On the contrary, my listItem has value (ex : "AutoComplete instance0
      > linkSearch,[object HTMLLIElement],john doe,789")
      >
      > Did I do something wrong somewhere to have nothing on dataArray ???
      >
      > Thanks for any help
      >
      > --- In ydn-javascript@yahoogroups.com, "jennykhan" <jennyhan@> wrote:
      > >
      > > Hi Florent,
      > >
      > > Looks like you need to define myHandler *before* you reference it in
      > > the subscribe method, like this:
      > >
      > > var myHandler = function(myAutoComp, listItem, dataArray)
      > > {
      > > document.getElementById("id").value = id;
      > > };
      > > myAutoComp.itemSelectEvent.subscribe(myHandler);
      > >
      > >
      > >
      > >
      > > --- In ydn-javascript@yahoogroups.com, "fmassiera" <fmassiera@> wrote:
      > > >
      > > > Hello,
      > > >
      > > > I would need some help about itemSelectEvent.
      > > > In fact, I got some javascript errors when I add the itemSelectEvent
      > > part.
      > > > Message is : s.fn has no properties
      > > > Line 217 from yui/event/event.js
      > > >
      > > > Thanks for any help
      > > >
      > > > Here is the code I use :
      > > >
      > > > <script type="text/javascript">
      > > > // An XHR DataSource
      > > > var myServer = {"ezdhtml/search"|ezurl};
      > > > var mySchema = ["ResultItem", "texte"];
      > > > var myDataSource = new YAHOO.widget.DS_XHR(myServer, mySchema);
      > > > myDataSource.responseType = YAHOO.widget.DS_XHR.TYPE_XML;
      > > > var myAutoComp = new
      > > > YAHOO.widget.AutoComplete("linkSearch","ysearchcontainer",
      > > myDataSource);
      > > > myAutoComp.minQueryLength = 3;
      > > >
      > > > myAutoComp.itemSelectEvent.subscribe(myHandler);
      > > > var myHandler = function(myAutoComp, listItem, dataArray)
      > > > {
      > > > document.getElementById("id").value = id;
      > > > };
      > > > </script>
      > > >
      > > > Florent
      > > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.