3

Is there a way to update UI elements asynchronously in JSF 2? For example a person is looking on the screen and some pieces on the screen get updated, when say a batch job changes some value.

Spenser
  • 31
  • 1

2 Answers2

1

There are a couple of solutions. One is e.g. a4j:push, which is further described here.

IceFaces is also known for this. Note that some of the components essentially do polling via AJAX, while others actually use reverse ajax/comet.

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
0

You can also use the <p:poll> provided by PrimeFaces.

Here is a working example:

<h:form>
    <h:outputText id="txt_count" value="#{counterView.number}" />
    <p:poll interval="3" listener="#{counterView.increment}" update="txt_count" />
</h:form>
alexander
  • 1,191
  • 2
  • 20
  • 40
  • Better to point to this: http://stackoverflow.com/questions/15903816/notification-system-with-ppoll-push A more extensive 'answer'... – Kukeltje Aug 06 '15 at 15:45