4 Replies Latest reply on Oct 21, 2008 7:52 PM by nbelaevski

    suggestionBox text search

      I've written a component that encapsuls suggestionBox
      the component does text search and suggests records from a db

      To optimize server performance I only suggest as a speciall character like space or question mark ... is entered... Technicaly this works.


      As text is entered, without an explict terminator, ( ex when hitting the submit button) ,, the parualy , non searched text is passed to the caller
      this was not the idea.


      internaly in suggestionBox can I submit an event,.... call a method
      to force the selection screen to appear ??


      I would be very gratefull, if someone can give me a hint
      tried generating a super.broadcast-queuEvent (Ajaxevent/ SelectSuggestionEvent) in the suggestionBox but I do not know what triggers the selection box

        • 1. Re: suggestionBox text search
          nbelaevski

          Hello,

          Here is how to force the selection screen:

          #{rich:component('suggestion')}.callSuggestion(true)
          - see that example in action here: http://livedemo.exadel.com/richfaces-demo/richfaces/suggestionBox.jsf?c=suggestionBox&tab=usage (it's the second one)

          • 2. Re: suggestionBox text search

            can I do the same thing without going to the client,

            part of the functionality, is a arrow down button just (suppoed) to pull the suggesting box down

            • 3. Re: suggestionBox text search

              Maybe I answerd a bit to fast,
              THe proposed solution only works is you explicitely push the down arrow...
              but there are multiple ways to leave the input behind, and have confusing input as a result.
              area
              I guess the ony common factor is the Decode()/decodeprocess method
              in de component.
              Thats normaly where the callSuggestion(true) ends up...

              I already need to be in the decode loop, to have the component update
              the text search, and to get to the real selected record (getRow() always returs - 1 except during the popup screen.

              • 4. Re: suggestionBox text search
                nbelaevski

                I doubt it is possible to show suggestion using server code. You can try to do org.richfaces.component.UISuggestionBox#setSubmitted(true) however I do not know whether this will work as expected for all cases.

                I have a feeling that I'm not getting you right. Can you please clarify your use case a bit so that I'll be able to suggest something?