Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. mainview.xhtml
  2. --backed by--> mainViewBean (request scope)
  3. --with managed property--> mainViewView (view scope)
  4.  
  5. include1.xhtml
  6. --backed by--> include1Bean (request scope)
  7. --with managed property--> mainViewBean
  8.  
  9. include2.xhtml
  10. --backed by--> include2Bean (request scope)
  11. --with managed property--> mainViewBean
  12.  
  13. include3.xhtml
  14. --backed by (and with component bindings to)--> include3Bean (request scope)
  15. --with managed property--> mainViewBean
  16.  
  17. include4.xhtml
  18. --backed by--> mainViewBean
  19.  
  20. var lastForm = null;
  21.  
  22. function getViewStateFromLastForm(callingElement){
  23.  
  24. var currentForm = $(callingElement).closest("form");
  25. var formId = currentForm.attr("id");
  26.  
  27. if(lastForm != null ){
  28. var viewState = $("#" + lastForm).children("[name='javax.faces.ViewState']").val();
  29. currentForm.children("[name='javax.faces.ViewState']").remove();
  30.  
  31. $('<input/>').attr({
  32. type: 'hidden',
  33. id: 'javax.faces.ViewState',
  34. name: 'javax.faces.ViewState',
  35. autocomplete: 'off',
  36. value: viewState
  37. }).appendTo(currentForm);
  38. }
  39. lastForm = formId;
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement