5 Replies Latest reply on Mar 4, 2011 9:42 AM by ilya_shaikovsky

    Suggestionbox performance issue

    qh3001

      Hi All,

       

      I am facing some performance issue with suggestion box.

      I have a page with 200 rows each row has 2 suggestion box for text field, the page takes more than 20 seconds to load,

       

         <rich:dataTable
               id="detail_table"
               width="auto"
               value="#{testBean.testList}" 
               var="record" 
               headerClass="GrayBackgroundHeader"
               rowKeyVar="row"
               ajaxRendered="true"
               rowClasses="TableRowOdd,TableRowEven">
               <f:facet name="header">
                   <rich:columnGroup>
                       <h:column>
                           <h:outputText value="ColumnA" />
                       </h:column>
                       <h:column>
                           <h:outputText value="ColumnB" />
                       </h:column>
                   </rich:columnGroup>
              </f:facet>
              <rich:columnGroup>
                   <h:column>
                       <h:inputText value="#{record}" id="text1" />
                       <rich:suggestionbox id="suggestionBoxId1" for="text1" selfRendered="true"/>
                   </h:column>
                   <h:column>
                       <h:inputText value="#{record}" id="text2" />
                       <rich:suggestionbox id="suggestionBoxId2" for="text2" selfRendered="true"/>
                   </h:column>
              </rich:columnGroup>
           </rich:dataTable>
      

       

      Above are my test codes. Am I using the suggest box incorrectly or pls help to advice to improve the performance.

       

      Thanks a lot~

        • 1. Re: Suggestionbox performance issue
          ksieee

          Hi, Bro. i've met the same prb. I've found that not only the suggestion box but also the canlender can't work fine with mutilple rows.

           

          may be this post will help you.

          http://www.codezealot.org/archives/35

          • 2. Re: Suggestionbox performance issue
            ilya_shaikovsky

            which browser and which RF version used?

             

            if not using 3.3.3.Final - please try it. we made much js optimization and further issues fixings there since 3.3.0.

            • 3. Re: Suggestionbox performance issue
              qh3001

              Hi,

               

              Yes, we are using the 3.3.3.Final and the browser is IE8.

              • 4. Re: Suggestionbox performance issue
                blanco

                I checked the SuggestionBoxRenderer.java sourceCode.   

                 

                 

                            writer.startElement("iframe", component);

                            writer.writeAttribute("src", getResource("/org/richfaces/renderkit/html/images/spacer.gif").getUri(context, null), null);

                            writer.writeAttribute("id", component.getClientId(context) + "_iframe", null);

                            writer.writeAttribute("style", "position:absolute;display:none;z-index:" + zIndex + ";", null);

                            writer.endElement("iframe");

                 

                 

                if you add 200 SuggestionBox in one page, then output 200 iframe in the page. Every iframe need send http request to server. it's big performace.

                 

                I suggest when client need an Iframe,  create an iframe object with javascript. Not create it in component render method.

                • 5. Re: Suggestionbox performance issue
                  ilya_shaikovsky

                  yup.. that's weird.. but the 3.3.x branch only for the community support for now and has no releases planned. So if you want - could patch as described there and also provide patch to us using jira and we will review for applying.