5 Replies Latest reply on Sep 15, 2008 11:17 AM by Daniel Roth

    Rich:calendar inside a datatable is very slow

    Tomasz Wilczynski Newbie

      Hi,
      I have a dataTable with 10 rows, and each row contains two rich:calendar tags. The page renders almost 10 seconds.


      Similar problem is described here but setting tooltipMode="none" gives no effect. Has anyone encountered this issue?

        • 1. Re: Rich:calendar inside a datatable is very slow
          Daniel Roth Apprentice

          Bean code and jsf page code please... ?

          • 2. Re: Rich:calendar inside a datatable is very slow
            Tomasz Wilczynski Newbie

            Sure. This is my dataTable containing 10 rows (I've cut the styles etc so it's more readable):



            <rich:dataTable value="#{client.externalAgencyRatings}" var="externalRating" id="agencyRatings" >
                <rich:column>
                    <s:decorate template="layout/edit.xhtml" id="userAgencyDecorate" >
                        <h:inputText value="#{externalRating.agencyName}" id="userAgency" />
                    </s:decorate>
                </rich:column>
                <rich:column>
                    <s:decorate template="layout/edit.xhtml" id="ratDecorate" >
                        <rich:calendar value="#{externalRating.agencyRatingDate}" id="ratDate" />
                    </s:decorate>
                </rich:column>
                <rich:column>
                    <s:decorate template="layout/edit.xhtml" id="expDecorate" >
                        <rich:calendar value="#{externalRating.agencyRatingExpirationDate}" id="expDate"/>
                    </s:decorate>
                </rich:column>
            </rich:dataTable>




            I can't see how the bean code is relevant. The problem is that the page contains 20 calendar controls and each one of them probably requires some javascript code to run. If I replace the tags <rich:calendar> with simple <h:inputText> the page renders quickly.

            • 3. Re: Rich:calendar inside a datatable is very slow
              Daniel Roth Apprentice

              There are quite a few times people have stupid and time consuming loops in their getters. That's why I always ask for the bean code :-) I assume you haven't dne that.



              I did a test with your dataTable, with 100 instances of externalAgencyRating. It took 1.561ms for the getExternalAgencyRatings call, 3.5s to send to browser and an additional 1.5s  to render. To me, that doesn't look too bad having 100 rows in the table. I used Seam-2.0.3.CR1 with RF-3.2.1.GA, firefox 3 on linux unbuntu.


              However, on Internet Explorer 7 on Windows XP it took approx. 30 seconds. Based on this I would say it's question for the RF people (and Microsoft...)

              • 4. Re: Rich:calendar inside a datatable is very slow
                Tomasz Wilczynski Newbie

                Sweet :) I'm obligated to work with IE7, even though I hate it.
                Thank you very much for your time, Daniel.


                PS. What tool (tools?) allows you to view the time intervals you mentioned?

                • 5. Re: Rich:calendar inside a datatable is very slow
                  Daniel Roth Apprentice

                  Measure time in bean (Hill's post): http://www.seamframework.org/Community/SeamPerformanceProblemRewardingWorkaround ( I have modified it a bit, but it could be used as is)


                  Measure time from access to last post: Added a tiny filter that esentially says done, and a stopwatch :-) (Start, split time on 'done' and stop when page is rendered). One could probably use Firebug to some extent, but I've seen it give outrageous timings, so I don't really trust it.


                  Cheers