Guest User

Untitled

a guest
Aug 14th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <h:form>
  2. <ace:pushButton id="button1" action="#{someBean.someFunction1}" label="Button1" />
  3. </h:form>
  4. <h:form>
  5. <ace:pushButton id="button2" action="#{someBean.someFunction2}" label="Button2" />
  6. </h:form>
  7.  
  8. function setTestButtonsOnclickFunctions() {
  9. var button1 = document.querySelector('[id*="button1_button"]');
  10. var button2 = document.querySelector('[id*="button2_button"]');
  11.  
  12. button1.onclick = function() {
  13. button2.click();
  14. var someRandomVariable = 10;
  15. };
  16.  
  17. button2.onclick = function() {
  18. button1.click();
  19. alert("Button1 was clicked from javaScript");
  20. var someRandomVariable = 10;
  21. };
  22. }
  23.  
  24. (function($) {
  25. $(document).ready(setTestButtonsOnclickFunctions);
  26. })(jQuery);
Add Comment
Please, Sign In to add comment