1 2 Previous Next 22 Replies Latest reply on Mar 5, 2009 8:05 AM by cibermon

    SuggestionBox

    cibermon

      Hi, I Have a problem with a suggestionBox. I have a jsp page in a well-functioning suggestionbox but i have another jsp page where it does not work well a suggestion box. The problem is that I always select the first item in the list of suggestions.

      The code of de jsp page is:


      <rich:suggestionbox id="idSugerenciasCen" suggestionAction="#{usuarioCentroBean.autoCompletarAvanzado}"
      var="centro" tokens="," fetchValue="#{centro.codcen}" width="350" height="200"
      for="idCentro" shadowOpacity="9" nothingLabel="Centro no encontrado.">
      <t:column>
      <h:outputText value="#{centro.codcen}" style="font-style:bold"/>
      </t:column>
      <t:column>
      <h:outputText value="#{centro.dencen}"/>
      </t:column>
      </rich:suggestionbox>



      UsuarioCentroBean.java



      public List autoCompletarAvanzado(Object begin){
      String prefijo = (String) begin;
      List resultado;
      if (centros == null) {
      centroBusqueda= new Centro();
      getCentros();
      }
      resultado = new ArrayList();
      Centro centroIt;
      for(Iterator itCentros = this.centros.iterator(); itCentros.hasNext();){
      centroIt = itCentros.next();
      if(((centroIt != null) && ((centroIt.getCodcen().indexOf(prefijo.toUpperCase()) == 0) ||
      (centroIt.getDencen().contains(prefijo.toUpperCase())) ||
      (centroIt.getLoccen().contains(prefijo.toUpperCase()))))){
      resultado.add(centroIt);
      }
      }
      return resultado;
      }

        • 1. Re: SuggestionBox

          disculpa tu puedes recuperar el valor de la palabra sugerida??? porque yo solo recupero lo q he tipeado en el input, mas no la palabra sugerida que escogà que es lo que realmente necesito.

          • 2. Re: SuggestionBox
            cibermon

            Si, en otra pagina jsp tengo un suggestionBox que funciona bien, y me selecciona la palabra sugerida, no la tecleada. El codigo es el mismo y en una pagina funciona y en otra no, y cuando digo el mismo digo exactamente el mismo.

            Saludos.

            • 3. Re: SuggestionBox
              cibermon

              Existe algun bug sobre este problema que tengo con el SuggestionBox en la versión richfaces 3.1.4.GA????

              • 4. Re: SuggestionBox
                cibermon

                strangely it works in all my pages except the JSF pages that do not have a <t:inputCalendar> after SuggestionBox

                • 5. Re: SuggestionBox
                  cibermon

                  By chance I have tested in IE7 and it works, wear it

                  I'm using the version 3.1.4.GA

                  • 6. Re: SuggestionBox
                    cibermon

                    By chance that tested in IE7
                    I explain it

                    • 7. Re: SuggestionBox
                      nbelaevski

                      Can you please add

                      <a4j:log popup="false" />
                      to the page and check if there are errors there?

                      • 8. Re: SuggestionBox
                        cibermon

                        This log is displayed when loading the list of suggestions

                        ....

                        debug[16:43:42,937]: search for elements by name 'INPUT' in element span
                        debug[16:43:42,937]: selectNodes found 0
                        debug[16:43:42,937]: Replace value for inputs: 32 by new values: 0
                        debug[16:43:42,937]: call selectSingleNode for id= _A4J.AJAX.focus
                        debug[16:43:42,937]: No focus information in response
                        debug[16:43:42,937]: call selectSingleNode for id= org.ajax4jsf.oncomplete
                        debug[16:43:42,937]: Call component oncomplete function after processing updates
                        debug[16:43:42,953]: call selectSingleNode for id= _ajax:data
                        debug[16:43:42,953]: AJAX response complete - updateChoices
                        debug[16:43:43,203]: render for index 0 and old index -1
                        debug[16:43:43,250]: Choices updated



                        this log is displayed after to select the 4º element of the list of suggestion


                        debug[16:41:44,250]: render for index 1 and old index 0
                        debug[16:41:44,354]: render for index 2 and old index 1
                        debug[16:41:44,788]: render for index 5 and old index 2
                        debug[16:41:45,212]: render for index 7 and old index 5
                        debug[16:41:45,386]: render for index 6 and old index 7

                        Something wrong?

                        • 9. Re: SuggestionBox
                          cibermon

                          I saw an interesting detail

                          debug[18:00:15,416]: NEW AJAX REQUEST !!! with form :buscaInsCen
                          debug[18:00:15,417]: Append text control buscaInsCen:idInspector with value [as] and value attribute [ASS69H]


                          I am doing research with the substring 'as' and
                          appears as value attribute = ASS69H, which is the first value in the list.

                          Is not that normal, no?

                          Saludos

                          • 10. Re: SuggestionBox
                            nbelaevski

                             

                            "cibermon" wrote:
                            I saw an interesting detail

                            debug[18:00:15,416]: NEW AJAX REQUEST !!! with form :buscaInsCen
                            debug[18:00:15,417]: Append text control buscaInsCen:idInspector with value [as] and value attribute [ASS69H]


                            I am doing research with the substring 'as' and
                            appears as value attribute = ASS69H, which is the first value in the list.

                            Is not that normal, no?

                            Saludos

                            Probably, I do not see the code for id="idInspector" component posted.
                            BTW, can you please describe the issue:
                            The problem is that I always select the first item in the list of suggestions.
                            more precisely?

                            • 11. Re: SuggestionBox
                              cibermon

                              I write the character 'a' and I get suggestions list that begin with the character 'a' and when I select any of these suggestions, I always pick the first element of that list item that I have not chosen.

                              • 12. Re: SuggestionBox
                                nbelaevski

                                In what browser does this reproduce?

                                • 13. Re: SuggestionBox
                                  cibermon

                                  in Mozilla Firefox 3.0.6

                                  • 14. Re: SuggestionBox
                                    cibermon

                                    Does anyone know if there is a bug on this?

                                    1 2 Previous Next