File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Continuous polling JSF component to refresh its state Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Continuous polling JSF component to refresh its state" Watch "Continuous polling JSF component to refresh its state" New topic
Author

Continuous polling JSF component to refresh its state

Robin Sharma
Ranch Hand

Joined: Aug 24, 2005
Posts: 76
Hi!

I am using some standard JSF (MyFaces) components in an application. I want the dataTable to keep polling the server and refresh its state every, say n seconds. How should i go about it? The component itself is not Ajax-aware. Can it be done using some third-party libraries like DWR etc?

Thanks.


DW
There is always a bug :-)
Ravisekhar Kopparthi
Greenhorn

Joined: Jul 12, 2006
Posts: 5
Hi Robin,

I don't remember any AJAX solution for your problem.

There is a simple trick in HTML

put this in head section of your JSP containing your JSF datatable
<head>
<meta http-equiv="refresh" content="600">
</head>

where 600 is the number of seconds the browser waits to refresh the page.

In your backing bean do a databind at every refresh.

Hope this helps.

Thanks
Ravi
Robin Sharma
Ranch Hand

Joined: Aug 24, 2005
Posts: 76
Originally posted by Ravisekhar Kopparthi:
Hi Robin,

I don't remember any AJAX solution for your problem.

There is a simple trick in HTML

put this in head section of your JSP containing your JSF datatable
<head>
<meta http-equiv="refresh" content="600">
</head>

where 600 is the number of seconds the browser waits to refresh the page.

In your backing bean do a databind at every refresh.

Hope this helps.

Thanks
Ravi


Hi Ravi!

This solution would be like a last resort as i have a lot of other data on the screen which will unnecessarily get submitted. What i want is a partial refresh for the dataTable component with polling capability.

Thanks anyways.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Continuous polling JSF component to refresh its state
 
Similar Threads
How to make a servlet as observer?????
async DB Notification to AppSrv when DB changes
JSF Tree structure
How Portlets and JSF are related
STATE_SAVING_METHOD