1 2 Previous Next 15 Replies Latest reply on Apr 4, 2007 11:04 AM by james_hays

    SuggestionBox inside ui:repeat not generating popup

    james_hays

      I'm not completely sure this is possible or that I'm doing it correctly, so if anybody has any advice, I'm all ears. So far, my attempts are not working.

      What I have is an iterator using <ui:repeat.
      note: the suggestionbox is at the end.

      <ui:repeat var="profileGate" value="#{profileRecord.profileGates}">
       <td colspan="1">
       <div class="productCell">
       <ul>
       <ui:repeat var="productRecord" value="#{profileGate.productRecords}">
       <li>
       <div class="removeProduct"/>
       <s:link view="/productManagement.xhtml" propagation="nest">
       <h:outputText value="#{productRecord.name}"/>
       <f:param name="id" value="#{productRecord.id}"/>
       </s:link>
       </li>
       </ui:repeat>
       </ul>
       <div class="addProductContainer">
       <h:form>
       <div class="addProduct"/>
       <h:inputText id="NewProductField" value="#{search.waNumber}" size="14"/>
       <rich:suggestionbox for="1_NewProductField"
       suggestionAction="#{viewProfileRecord.autoCompleteAvailablelProducts}"
       ajaxSingle="true" var="p"
       width="500" height="200">
       <h:column>
       Just dump something out...
       </h:column>
       </rich:suggestionbox>
       </h:form>
       </div>
       </div>
       </td>
      </ui:repeat>
      


      I can see the request hitting the server and FireBug show the response coming back, but no popup is displaying. I have this working in other places, but not in an iterator.

      My initial thought was that the ID was not unique. I'm not getting that in an error though and it appears to have an id prefixed to it, so I've tossed out that notion.

      Any thoughts?

      Thanks,

      James

        • 1. Re: SuggestionBox inside ui:repeat not generating popup
          james_hays

          BTW. This is the case in both version 3.0 and the snapshot from 3/29

          • 2. Re: SuggestionBox inside ui:repeat not generating popup
            james_hays

            DOH!!

            The for(1_ is not present in my code. I was trying something that snuck into my copy and paste. Both ID and FOR are the same value.

            • 3. Re: SuggestionBox inside ui:repeat not generating popup

              You should not use h:form inside the ui:repeat (does not matter do you have suggestionbox or not)

              • 4. Re: SuggestionBox inside ui:repeat not generating popup
                james_hays

                 

                "SergeySmirnov" wrote:
                You should not use h:form inside the ui:repeat (does not matter do you have suggestionbox or not)


                I've moved the form outside of my repeats and outside of my table, so there is not just one form on the page.

                No luck though. The popup still does not appear. Looking at the firebug request/response, all seems to be working on that end.

                Has anybody else gotten the suggestionbox working in a repeat?

                • 5. Re: SuggestionBox inside ui:repeat not generating popup
                  ilya_shaikovsky

                  http://jira.jboss.com/jira/browse/RF-25

                  there is a link to forum thread connected with suggestion inside tables usage. Take the build with the bug fixed and try to use ForceRender listener.

                  (component tries to reRender the popup inside concrete row, but without this listener the row can't be found)

                  • 6. Re: SuggestionBox inside ui:repeat not generating popup
                    james_hays

                    well, we're getting closer. :) I've updated to the latest nightly snapshot build of 3.0.1 and things seem to work well in FireFox, but nothing in IE 6. It doesn't even seem to submit a request.

                    Thanks.

                    • 7. Re: SuggestionBox inside ui:repeat not generating popup

                       

                      "james_hays" wrote:
                      "SergeySmirnov" wrote:
                      You should not use h:form inside the ui:repeat (does not matter do you have suggestionbox or not)


                      I've moved the form outside of my repeats and outside of my table, so there is not just one form on the page.

                      It is still not enough. The whole modal panel is moved up to be a child of the . So, it does not matter where you define the external form. You need the one inside the modal panel.

                      • 8. Re: SuggestionBox inside ui:repeat not generating popup
                        james_hays

                         

                        "SergeySmirnov" wrote:
                        "james_hays" wrote:
                        "SergeySmirnov" wrote:
                        You should not use h:form inside the ui:repeat (does not matter do you have suggestionbox or not)


                        I've moved the form outside of my repeats and outside of my table, so there is not just one form on the page.

                        It is still not enough. The whole modal panel is moved up to be a child of the <body>. So, it does not matter where you define the external form. You need the one inside the modal panel.


                        Can you clarify? Where do I specify this then? I don't explicitly create a modal panel. Anything that is created in this instance that would need a form is created by RichFaces unless I'm missing something.

                        • 9. Re: SuggestionBox inside ui:repeat not generating popup

                          Doh. Ignore my answer. I confused your question with the one from another thread.

                          • 10. Re: SuggestionBox inside ui:repeat not generating popup
                            ilya_shaikovsky

                            Post please you? latest post. Have you used proper listener?

                            • 11. Re: SuggestionBox inside ui:repeat not generating popup
                              james_hays

                              Here's my current code using SuggestionBox.

                              I've removed my forms from the iterator and am using the ForceRender as mentioned in another post.
                              <a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender"/>

                              <ui:repeat var="profileGate" value="#{profileRecord.profileGates}">
                               <td colspan="1">
                               <div class="productCell">
                               <ul>
                               <ui:repeat var="productRecord" value="#{profileGate.productRecords}">
                               <li>
                               <div class="removeProduct"/>
                               <div><s:link view="/productManagement.xhtml" propagation="nest">
                               <h:outputText value="#{productRecord.name}"/>
                               <f:param name="id" value="#{productRecord.id}"/>
                               </s:link></div>
                               </li>
                               </ui:repeat>
                               </ul>
                               <div class="addProductContainer">
                               <div class="addProduct"/>
                               <h:inputText id="NewProductField" value="#{search.waNumber}" size="14"/>
                               <rich:suggestionbox for="NewProductField"
                               suggestionAction="#{viewProfileRecord.autoCompleteAvailableProducts}"
                               ajaxSingle="true" var="p"
                               width="500" height="200">
                               <h:column>
                               <h:outputText value="#{p[0]}"/>
                               </h:column>
                               <a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender"/>
                               </rich:suggestionbox>
                               </div>
                               </div>
                               </td>
                              </ui:repeat>
                              


                              • 12. Re: SuggestionBox inside ui:repeat not generating popup

                                Try to have<a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender"/> as a child of rich:suggestionbox

                                • 13. Re: SuggestionBox inside ui:repeat not generating popup
                                  james_hays

                                   

                                  "SergeySmirnov" wrote:
                                  Try to have<a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender"/> as a child of rich:suggestionbox


                                  It is.

                                  <rich:suggestionbox for="NewProductField"
                                   suggestionAction="#{viewProfileRecord.autoCompleteAvailableProducts}"
                                   ajaxSingle="true" var="p"
                                   width="500" height="200">
                                   <h:column>
                                   <h:outputText value="#{p[0]}"/>
                                   </h:column>
                                   <a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender"/>
                                   </rich:suggestionbox>
                                  


                                  • 14. Re: SuggestionBox inside ui:repeat not generating popup
                                    ilya_shaikovsky

                                    Sorry, but could you please update your library to latest SNAPSHOT version because my next code works under:

                                    <ui:repeat value="#{capitalsBean.capitals}" var="#{cap}">
                                     <h:panelGrid columns="1">
                                     <h:inputText value="#{cap.text}" id="test"/>
                                     <rich:suggestionbox for="test" width="200" height="200" suggestionAction="#{bean.autocomplete}" var="cap">
                                     <a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender"/>
                                     <h:column>
                                     <h:outputText value="#{cap.text}"></h:outputText>
                                     </h:column>
                                     </rich:suggestionbox>
                                     </h:panelGrid>
                                    </ui:repeat>
                                    


                                    1 2 Previous Next