1 Reply Latest reply on May 12, 2010 7:51 AM by ilya_shaikovsky

    rich:suggestionBox and empty query

    volothamp

      Hello, dear richfaces developers.

       

      Do you know if there is an easy way to make the autocomplete action of the rich:suggestionBox to be fired even with an empty string in it?

       

      I would like to have this user case:

       

      1. User goes into the input field

      2. User presses the spacebar

      3. All the results of my backing bean are showed.

       

      Thank you very much!

       

      Bye

        • 1. Re: rich:suggestionBox and empty query
          ilya_shaikovsky

          seems something like that should works

           

           

          <h:inputText value="#{capitalsBean.capital}" id="text" styleClass="myinput" onkeyup="#{rich:component('suggestionBoxId')}.callSuggestion(true)"/>
           
          <rich:suggestionbox id="suggestionBoxId" for="text" tokens=",[]"
          

          additionally it's maybe could be nessesary to check if there are only spaces in input o r text with some space in order to pass param properly. but I think you could add such js.