Advertisement
Guest User

Untitled

a guest
Apr 26th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <apex:commandbutton value="Do Stuff" onclick="ProceedJS();" immediate="true" action="{!DoPageRedirect}" />
  2.  
  3. <apex:actionFunction name="ProceedJS" reRender="pageState" oncomplete="return confirmProceed();" />
  4. <apex:outputText value="{!dataSaved}" id="pageState" />
  5.  
  6. function confirmProceed()
  7. {
  8. var dataSaved = document.getElementById('myPage:myForm:myBlock:pageState').innerHTML ;
  9. alert('Action function complete....Data saved var: ' + dataSaved);
  10. if(dataSaved == 'false') {
  11.  
  12. if(confirm('Are you sure you wish to continue - any unsaved changes will be lost.')) {
  13.  
  14. }
  15. else { return false; }
  16. }
  17. }
  18.  
  19. <apex:commandbutton value="Do Stuff" onclick="return confirmProceed();" immediate="true" action="{!DoPageRedirect}"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement