Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:commandbutton value="Do Stuff" onclick="ProceedJS();" immediate="true" action="{!DoPageRedirect}" />
- <apex:actionFunction name="ProceedJS" reRender="pageState" oncomplete="return confirmProceed();" />
- <apex:outputText value="{!dataSaved}" id="pageState" />
- function confirmProceed()
- {
- var dataSaved = document.getElementById('myPage:myForm:myBlock:pageState').innerHTML ;
- alert('Action function complete....Data saved var: ' + dataSaved);
- if(dataSaved == 'false') {
- if(confirm('Are you sure you wish to continue - any unsaved changes will be lost.')) {
- }
- else { return false; }
- }
- }
- <apex:commandbutton value="Do Stuff" onclick="return confirmProceed();" immediate="true" action="{!DoPageRedirect}"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement