7 Replies Latest reply on Sep 10, 2010 5:33 AM by ilya_shaikovsky

    Suggestionbox and datatable

    romaintaz

      Hi all,

      I have a question about the suggestionbox:
      How can I put a suggestion box on an input text that is displayed in a row of a datatable.

      The problem is that I can't give an ID to the inputText contained in a rich:column component. Thus, I can't set the "for" attribute of my suggestionbox.

      How can I do that, then?

      Thanks.

        • 1. Re: Suggestionbox and datatable
          ilya_shaikovsky

           

          ...
           <rich:column>
           <h:inputText value="#{cap.name}" id="sugg"></h:inputText>
           <rich:suggestionbox height="200" width="200" for="sugg" suggestionAction="#{bean.autocomplete}" ajaxSingle="true" var="cit">
           <rich:column>
           <h:outputText value="#{cit.text}"></h:outputText>
           </rich:column>
           </rich:suggestionbox>
           </rich:column>
          ...


          works for me

          • 2. Re: Suggestionbox and datatable
            jenkinsa

            Has anyone got this working? I've got a suggestionbox in a datatable and, while the first row works fine, if my table has more than one row the suggestionbox doesn't function (doesn't call my suggestAction method)...no errors in rich:messages, nothing in a4j:log??? I'm using 3.2.0.SR1

            Any thoughts anyone? (code below)...it's just a string field, no complex objects

             <rich:column>
             <f:facet name="header">
             <h:outputText value="#{msg['city']}"/>
             </f:facet>
             <h:inputText id="criteriaCity"
             value="#{criteria.city}"
             size="10"
             readonly="#{criteria != PremiumPostEdit.selectedCriteria}">
             <a4j:support ajaxSingle="true" event="onblur" reRender="currentMaxBidAmount"/>
             </h:inputText>
             <rich:suggestionbox for="criteriaCity"
             suggestionAction="#{criteria.listCities}"
             var="city"
             fetchValue="#{city}"
             minChars="1"
             nothingLabel="#{msg['nomatchingcity']}"
             frequency="0"
             height="100"
             width="100"
             ajaxSingle="true">
             <rich:column>
             <h:outputText value="#{city}"/>
             </rich:column>
             </rich:suggestionbox>
             </rich:column>
            


            • 3. Re: Suggestionbox and datatable
              _max_

              Hi,

              I have the same problem : only the first row works fine !

              Is it a bug ?

              RichFaces 3.2.0.SR1
              MyFaces 1.2.3
              Facelets 1.1.14
              Tomcat 6

              • 4. Re: Suggestionbox and datatable
                specialagent

                It seems that ajaxKeys in dataTable is the problem. Seems like a bug. I opened a Jira issue:

                 

                https://jira.jboss.org/browse/RF-9326

                 

                Greets

                • 5. Re: Suggestionbox and datatable
                  ilya_shaikovsky

                  At first - use latest release version. Even if the issue will be confirmed for 3.2.0 but already resolved for 3.3.3 Final - we not providing issues backporting.

                  • 6. Re: Suggestionbox and datatable
                    specialagent

                    Hi Ilya, it does not work for 3.3.3GA. I mentioned this in the issue as well.

                    • 7. Re: Suggestionbox and datatable
                      ilya_shaikovsky

                      thanks.. we will check.