Standart JSF 2.0 components does not supply this feature, that's why third party libraries are used to push HTML page, such as; Primefaces(<p:push>), RichFaces(<a4j:push>) and IceFaces(IcePush). However, while applying these features of these libraries, we may get in trouble with the server that we use. It may take time to configure the server and reach the solution!
Hence, I recommend <p:poll> of Primefaces. In polling mechanism, client sends ajax request to the server every 'X' seconds that we can configure. Then, server can update HTML page within necessities.
It is very easy to apply it on JSF projects;
<p:poll interval="10" listener="#{bean.checkNotification}" oncomplete="prepareUI()" update=":form:growl :form:isUpdated" />
Hiç yorum yok:
Yorum Gönder