7 Replies Latest reply on Mar 10, 2012 3:56 PM by Tomas Cerny

    RichFaces 4 SuggestionBox - what is status?

    Mette Hummel Newbie

      In which release is suggestionBox planned to be implemented ? Or is autocomplete replacing suggestionBox?

        • 1. Re: RichFaces 4 SuggestionBox - what is status?
          Ilya Shaikovsky Master

          autocomplete available from M3 and stabilization fixes will be released in M4

          • 2. Re: RichFaces 4 SuggestionBox - what is status?
            Mette Hummel Newbie

            Does that mean that autocomplete is going to replace suggestionBox?

            • 4. Re: RichFaces 4 SuggestionBox - what is status?
              Mette Hummel Newbie

              is layout="table" implemented in Milestone 3 ? I can't get the example with layout="table" to work.

              • 5. Re: RichFaces 4 SuggestionBox - what is status?
                Ilya Shaikovsky Master

                <rich:autocomplete mode="cachedAjax" tokens=", " minChars="0"
                autoFill="false" selectFirst="false" layout="table"
                autocompleteList="#{capitalsBean.capitals}" var="cap" fetchValue="#{cap.name}">
                <rich:column>
                #{cap.name}
                </rich:column>
                <rich:column>
                #{cap.state}
                </rich:column>
                </rich:autocomplete>

                          <rich:autocomplete mode="cachedAjax" tokens=", " minChars="0"

                               autoFill="false" selectFirst="false" layout="table"

                               autocompleteList="#{capitalsBean.capitals}" var="cap" fetchValue="#{cap.name}">

                                    <rich:column>

                                         #{cap.name}

                                    </rich:column>

                                    <rich:column>

                                         #{cap.state}

                                    </rich:column>                    

                               </rich:autocomplete>

                initially rendered fine but I found weird problems at client side and filled issue (thanks!) https://jira.jboss.org/browse/RF-9672

                 

                So probably would be better to use something like

                 

                          <rich:autocomplete mode="cachedAjax" tokens=", " minChars="0"

                               autoFill="false" selectFirst="false"

                               autocompleteList="#{capitalsBean.capitals}" var="cap" fetchValue="#{cap.name}">

                                         #{cap.name} - #{cap.state}

                               </rich:autocomplete>

                 

                at least for now./

                • 6. Re: RichFaces 4 SuggestionBox - what is status?
                  Tomas Cerny Novice

                  Ilya, is there some way to pass the whole object to my method as a parameter? It was possible with RichFaces 3.3, but I do not see a way now.

                   

                  An example:

                   

                  <rich:autocomplete mode="cachedAjax" tokens=", " minChars="0"

                                 autoFill="false" selectFirst="false"

                                 autocompleteList="#{capitalsBean.capitals}" var="cap" fetchValue="#{cap.name}">

                                           #{cap.name} - #{cap.state}

                   

                      <a4j:support  event="onselect" 

                                                 action="#{bean.setCap(cap)}" />

                  </rich:autocomplete>

                   

                   

                  Thank you in advance,

                  T.

                  • 7. Re: RichFaces 4 SuggestionBox - what is status?
                    Tomas Cerny Novice

                    Hi Ilja,

                     

                    I also tried to use rich:select, although I am getting not what I want. Look over my code bellow:

                     

                                      <rich:select

                                                 id="instSug"

                                                 enableManualInput="true"

                                                 onkeyup="suggestInst(this.value);"

                                                 value="#{currentUser.personInfo.institution}" >                          

                                                 <f:selectItems

                                                      id="instVals"

                                                     var="inst"

                                                     value="#{suggestInstitution.resultList}"

                                                      itemValue="#{inst.name}" itemLabel="#{inst.name}" />

                                               

                                            </rich:select>

                                           

                                            <a4j:jsFunction name="suggestInst"

                                                    id="instFunc"

                                                    execute="instSug"                  

                                                    render="instSug instFunc">

                                                    <a4j:param name="param1"

                                                             assignTo="#{suggestInstitution.searchCriteria}"/>

                                      

                                                </a4j:jsFunction>  

                     

                    The problem with this that I can only get suggestion for samthing that starts with, but this not what most of developers want I want to provide user anythink like %search, but this is not possible with rich:select component. It is only possible with the autocomplete that does have a way to set object (Person, Car, etc). Furthermore, my solution above, would be better if I could render="instVals" but that one does not work.

                     

                    One statement made for RichFaces 4 is that they cover what was offered Richfaces 3.3 so how do I do this

                     

                      <a4j:support  event="onselect" 

                                                   action="#{bean.setCap(cap)}" />

                     

                    with richfaces 4? .

                     

                    Thanks