
If user clicks on cross icon on tab to close the tab with out saving data then i need to display unsaved changes dialog box.
I am able to show that dialog box but when user selects save on dialog box, need to execute my controller method which is not working. below is my page code. Can anyone help me on this.
<apex:page standardController="Case" extensions="CloseTabValidationSampleController">
<apex:includeScript value="/support/console/28.0/integration.js"/>
<script type="text/javascript">
window.onload=testSetTabUnsavedChanges;
function testOnTabSave() {
sforce.console.onTabSave(handleSave);
}
var handleSave = function handleSave(result) {
//Perform save logic here
exeSave();
sforce.console.setTabUnsavedChanges(false, undefined, result.id);
};
function testSetTabUnsavedChanges() {
sforce.console.getFocusedSubtabId(setTabDirty);
};
function setTabDirty(result) {
sforce.console.setTabUnsavedChanges(true, displayResult, result.id);
};
function displayResult(result)
{
testOnTabSave();
};
</script>
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputText value="{!Caseob}"/>
<apex:actionFunction name="exeSave" action="{!exeMethod}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
This Answers Community is focused on configuration and design questions. Programmatic questions are best submitted to the developer forums at https://developer.salesforce.com where the forums and participants are geared toward programming troubleshooting and support.