Decrease load time for data table page containing more than 500 transactions

爷,独闯天下 提交于 2019-12-20 06:09:30

问题


  1. Is there a way to decrease the load time of the page in IE just by using Data tables.
  2. If we use server side pagination and sorting, can we also do a quick search on server side and also render only that particular tab instead of the whole page.

    <h:panelGroup id="transactionsPanel"> <h:dataTable> </h:dataTable> <ui:repeat value="#{backing.pages}" var="page" varStatus="current"> <h:commandLink value="#{page}" actionListener="#{backing.page}" rendered="#{page != backing.currentPage}" > <f:ajax render="transactionsPanel"/> </h:commandLink> <ui:repeat>
    </h:panelGroup>

The listener is called but the page is not updated to display the next page clicked.


回答1:


Is there a way to decrease the load time of the page in IE just by using Data tables.

No.

At least, not without replacing IE by a more sane webbrowser. IE is known to have a poor HTML <table> renderer. This is a client problem, not a server (JSF) problem. You can confirm this by measuring the network traffic speed and browser HTML rendering speed.


If we use server side pagination and sorting, can we also do a quick search on server side and also render only that particular tab instead of the whole page.

Just perform the search (by ajax) in server side as well.

I recommend to look at JSF component libraries instead of grabbing to loose jQuery plugins and cobbling loose scripts together. PrimeFaces for example has a lazily loadable <p:dataTable> which solves all your problems with just clean XHTML and JPA. See also the lazy <p:dataTable> showcase example and Efficient JSF Pagination.



来源:https://stackoverflow.com/questions/12958612/decrease-load-time-for-data-table-page-containing-more-than-500-transactions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!