Bascially I have a page for editing Events that needs to warn a user of unsaved changes when moving page. If the server throws an error I use Seams redirect filter to go to error.xhtml, however this pops up the confirm dialog and allows users to cancel the page redirect and remain on the broken editing page.
Can I change the below code to pull out where I'm being directed to? I've tried window.location but that still says the Event page. Is there something like a window.redirect?
<script language="JavaScript" >
window.onbeforeunload = confirmExit;
function confirmExit(){
if(isEventModified()){return "The Event has unsaved changes!";}
}
</script>