2 Replies Latest reply on Jun 10, 2009 5:12 AM by jaand96

    combobox vs suggestion

      Hi,

      If I use rich:suggestion on a f:inputfield I have the suggestAction parameter that maps to a method that takes the entered value as parameter.

      I'd prefer to use the rich:combobox (have a custom "entityconverter") but how do I get a hold of the value that is in the combobox's input field currently?

      I use that value to query the database (cache).

      Also, there is no minChars on the combobox... (that I can get around "manually" though)

      thanks!

        • 1. Re: combobox vs suggestion
          nbelaevski

          Hi,

          Use

          value="#{bean.property}"
          to get the value input. You can add a4j:support, that each change on the client will update server model as well - check example at livedemo.

          • 2. Re: combobox vs suggestion

            Thanks!

            Got a4j:support to work just before i read your answer, so'll stick with that for now:

            <rich:suggestionbox
             for="nextpp"
             var="pp"
             suggestionAction="#{ProductionPointController.autocompleteProductionPoint}"
             minChars="2"
             requestDelay="500">
             <h:column>
             <h:outputText value="#{pp.ak1}" />
             </h:column>
             <h:column>
             <h:outputText value="#{pp.name}" />
             </h:column>
             <a4j:support event="onselect" action="#{ProductionPointController.setSelectedNextProductionPoint(pp)}"></a4j:support>
            </rich:suggestionbox>