• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF render continously

 
eddy johns
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm new to JSF so excuse the newbie question.

I need to continuously update a text field with values that come from the server. The idea is similar to that of a clock, updating every one second (for example.) I was thinking I could use this tag:

<f:ajax render="serverData"/>

but with something like render-continuously, as in:

<f:ajax render-continuously="serverData"/>

but of course render-continuously doesn't exist...

So, how do you achieve this?

Thanks!

Eddy
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18226
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Continuously is a bit much. It sounds more like you want to poll at one-second intervals.

I'm no expert on the new JSF2 ajax tag, but the JBoss RichFaces extension tagset includes a "poll" tag to handle stuff like that.
 
eddy johns
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Tim.

I'm looking into the solution you're suggesting and I'm running into a problem.

The following code, from the tutorial on the web on this tag:

<hutputText id="txt_count" value="#{navBean.count}" />
<p:poll actionListener="#{navBean.increment}" interval="1000" update="txt_count" />

is in a

<f:view>
<h:form>

with the appropriate closing tags. But when I try to hit the page it generates a Property 'increment' not found on type com.roberts.ui.NavBean exception, and the page isn't rendered.

The increment method is there in the bean:

public void increment(ActionEvent actionEvent) {
count++;
}

What am I doing wrong? Any help would be greatly appreciated!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic