You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "John Singleton (JIRA)" <de...@myfaces.apache.org> on 2007/07/30 11:05:52 UTC
[jira] Created: (MYFACES-1691) beforeUnload event handler breaks
form submission
beforeUnload event handler breaks form submission
-------------------------------------------------
Key: MYFACES-1691
URL: https://issues.apache.org/jira/browse/MYFACES-1691
Project: MyFaces Core
Issue Type: Bug
Components: General
Affects Versions: 1.1.5
Environment: Windows XP, IE7
Reporter: John Singleton
I am using the onBeforeUnload event to prevent the user leaving the page without first saving their work.
If the user cancels the page navigation, further navigation in the page fails. I tracked this down to this call in oamSubmitForm
document.forms[formName].submit();
In IE when the user cancels navigation of the page the form.submit method throws an exception. This isn't caught in oamSubmitForm and so it doesn't complete cleanly.
I fixed this by changing the 2 calls to form.submit too:
try { document.forms[formName].submit(); } catch (e) {}
oamSubmitForm now completes cleanly and further navigation in the page succeeds.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (MYFACES-1691) beforeUnload event handler breaks
form submission
Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588159#action_12588159 ]
Leonardo Uribe commented on MYFACES-1691:
-----------------------------------------
I have tested this on firefox and IE and it's a specific bug for IE.
So, the solution for avoid this is as suggested, surround submit call with a try catch.
> beforeUnload event handler breaks form submission
> -------------------------------------------------
>
> Key: MYFACES-1691
> URL: https://issues.apache.org/jira/browse/MYFACES-1691
> Project: MyFaces Core
> Issue Type: Bug
> Components: General
> Affects Versions: 1.1.5, 1.2.0, 1.2.2
> Environment: Windows XP, IE7
> Reporter: John Singleton
> Assignee: Leonardo Uribe
>
> I am using the onBeforeUnload event to prevent the user leaving the page without first saving their work.
> If the user cancels the page navigation, further navigation in the page fails. I tracked this down to this call in oamSubmitForm
> document.forms[formName].submit();
> In IE when the user cancels navigation of the page the form.submit method throws an exception. This isn't caught in oamSubmitForm and so it doesn't complete cleanly.
> I fixed this by changing the 2 calls to form.submit too:
> try { document.forms[formName].submit(); } catch (e) {}
> oamSubmitForm now completes cleanly and further navigation in the page succeeds.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.