6 Replies Latest reply on Mar 2, 2009 11:04 AM by cibermon

    rich:suggestionbox How to get selected value

      i started with rich faces 2 weeks ago and need help :(

      I need capture the value selected, for example if I type "ab" ... show me "ab1, ab2, ab3...", I clicked over ab3, but the value in my bean still is "ab", using reRender the value in the inputText is "ab3" but in my bean no... how can i solve this?
      i need capture the value "ab3" in my bean
      i thx u

        • 1. Re: rich:suggestionbox How to get selected value

          Hello, SirGhost

          Please post full page code (RF).

          • 2. Re: rich:suggestionbox How to get selected value

            <h:inputText value="#{bean.fullname}" id="fullname" >
            <a4j:support event="onchange" actionListener="#{bean.getInfo}" reRender="fullname" />
            </h:inputText>
            <rich:suggestionbox id="suggestionBoxId" for="fullname"
            suggestionAction="#{bean.autocomplete}" var="result"
            fetchValue="#{result.fullname}"
            width="200" height="150" reRender="InputDoc">
            <h:column>
            <h:outputText value="#{result}"/>
            </h:column>
            </rich:suggestionbox>

            I'm using RichFaces 3.3.0 GA

            that's right? plz :(

            • 3. Re: rich:suggestionbox How to get selected value

              :O) i try to understand, but just can't..

              Please post full page code (what is "InputDoc"?)
              and code of bean functions.
              thanx

              • 4. Re: rich:suggestionbox How to get selected value
                nbelaevski
                • 5. Re: rich:suggestionbox How to get selected value

                  <h:inputText value="#{bean.fullname}" id="fullname" >
                  <a4j:support event="onchange" actionListener="#{bean.getInfo}" reRender="fullname" />
                  </h:inputText>
                  <rich:suggestionbox id="suggestionBoxId" for="fullname"
                  suggestionAction="#{bean.autocomplete}" var="result"
                  fetchValue="#{result.fullname}"
                  width="200" height="150" reRender="InputDoc">
                  <h:column>
                  <h:outputText value="#{result.fullname}"/>
                  </h:column>
                  <a4j:support ajaxSingle="true" event="onselect">
                  <f:setPropertyActionListener value="#{result.nombreCompleto}" target="#{bean.fullname}" />
                  </a4j:support>

                  </rich:suggestionbox>

                  Thx a lot!!! :D my bean has the full name now. really thx :D

                  • 6. Re: rich:suggestionbox How to get selected value
                    cibermon

                    Try this code:

                    <h:inputText value="#{bean.fullname}" id="fullname" />

                    <rich:suggestionbox id="suggestionBoxId" for="fullname"
                    suggestionAction="#{bean.autocomplete}" var="result"
                    fetchValue="#{result.fullname}"
                    width="200" height="150">
                    <h:column>
                    <h:outputText value="#{result.fullname}"/>
                    </h:column>
                    </rich:suggestionbox>


                    "SirGhost" wrote:
                    <h:inputText value="#{bean.fullname}" id="fullname" >
                    <a4j:support event="onchange" actionListener="#{bean.getInfo}" reRender="fullname" />
                    </h:inputText>
                    <rich:suggestionbox id="suggestionBoxId" for="fullname"
                    suggestionAction="#{bean.autocomplete}" var="result"
                    fetchValue="#{result.fullname}"
                    width="200" height="150" reRender="InputDoc">
                    <h:column>
                    <h:outputText value="#{result}"/>
                    </h:column>
                    </rich:suggestionbox>

                    I'm using RichFaces 3.3.0 GA

                    that's right? plz :(