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

Problems with Auto Complete component

Expand Messages
  • juancamiloprezhoyos
    Hello..... I don´t know wath i miss for the Auto Complete component works fine. I have a JSP file with a JS file, like this: JSP
    Message 1 of 1 , Mar 31, 2008
    • 0 Attachment
      Hello.....

      I don´t know wath i miss for the Auto Complete component works fine.
      I have a JSP file with a JS file, like this:

      JSP

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

      <f:view>
      <html>
      <head>
      <title>Pruebas Componente AutoCompletar de Yahoo/Yui</title>
      <link type="text/css" rel="stylesheet" href="css/autocomplete.css">
      <script type="text/javascript" src="js/yahoo-dom-event.js"><!--
      --></script>
      <script type="text/javascript" src="js/autocomplete-min.js"><!--
      --></script>
      <script type="text/javascript" src="js/pruebas.js"><!-- --></script>
      </head>
      <body>
      <h:form id="testAutoCompleteYahooForm">

      <div id="myAutoComplete">
      <h:outputText value="Ciudad:"/>
      <h:inputText id="myInput"/>
      <div id="myContainer"></div>
      </div>
      <f:verbatim>
      <script>
      myList();
      </script>
      </f:verbatim>
      </h:form>
      </body>
      </html>
      </f:view>


      JS

      function myList() {
      var myArray = [
      "Armenia",
      "Arauca",
      "Argelia",
      "Antioquia",
      "Buenaventura",
      "Buenavista",
      "Caqueta",
      "Cordoba",
      "Chigorodo",
      "Guarne",
      "Granada"
      ];
      // Instantiate first JS Array DataSource
      var list = new YAHOO.widget.DS_JSArray(myArray);
      // Instantiate first AutoComplete
      listComp = new YAHOO.widget.AutoComplete('myInput','myInput', list);
      listComp.prehighlightClassName = "yui-ac-prehighlight";
      listComp.typeAhead = true;
      listComp.useShadow = true;
      listComp.minQueryLength = 0;
      listComp.maxResultsDisplayed = 10;
      };


      Any opinion on how to work with these components is greatly appreciated!!!

      Juan Camilo Pérez
    Your message has been successfully submitted and would be delivered to recipients shortly.