How to get a JSF2 table to be updated from time to time?
I have a page that enables the user to start a proccess that should update a table on this page from time to time. It already loads the data on the page, but I want the page to update itself alone on a given interval. What is the best way to do tha开发者_如何转开发t?
Most JSF2 component libraries offer a Poll component, which refreshes the page or selected parts of it in regular intervals.
http://www.primefaces.org/showcase-labs/ui/ajaxPollHome.jsf
http://composite-component-showcase.icefaces.org/ee-composite-showcase/showcase.jsf
..etc.
AFAIK JSF2 has no built-in poll component. If you still want to stick to raw JSF2 then have a look at this article, to see how to implement one (it's not hard):
http://weblogs.java.net/blog/driscoll/archive/2009/07/a_tale_of_two_c.html
But why sweat with bare JSF2 when you have excellent component libraries at your disposal?
a4j:poll
精彩评论