Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public class Bean
  2. {
  3. public void test()
  4. {
  5. System.out.println(System.currentTimeMillis());
  6. }
  7. }
  8.  
  9.  
  10.  
  11.  
  12. <script>
  13. window.setInterval(function()
  14. {
  15. //bean.test()
  16.  
  17. }, 1000);
  18.  
  19. </script>
  20.  
  21. <h:form id="form">
  22. <h:outputText id="txt_count" value="#{counterBean.count}" />
  23.  
  24. <p:poll interval="3"
  25. listener="#{counterBean.increment}" update="txt_count" />
  26. </h:form>
  27.  
  28. <p:remoteCommand name="callback" actionListener="#{bean.test}"/>
  29.  
  30. <h:outputScript>
  31. window.setInterval(function() {
  32. callback();
  33. }, 1000);
  34. </h:outputScript>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement