• Post Reply Bookmark Topic Watch Topic
  • New Topic

Continuous polling JSF component to refresh its state

 
Robin Sharma
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ravisekhar Kopparthi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!