struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pablo Vázquez Blázquez <pvazq...@denodo.com>
Subject Struts2 + Dojo 0.4 + unbeforeunload problem
Date Fri, 05 Sep 2008 10:01:12 GMT
Hi!!

If I have the following code in a jspx loaded via <s:div>, when I go to 
another page (also loaded via <s:div>) the "onbeforeunload" event is not 
triggered. It is only triggered when the page is not loaded using ajax.

What can I do to make it works both when the page is downloaded at all 
from server and when only a part is using ajax (using <s:div> tag)?

<jsp:root xmlns="http://www.w3.org/1999/xhtml"
    xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:s="/struts-tags"
    xmlns:scheduler="/scheduler-html.tld"
    version="2.0">

<script type="text/javascript">
        onbeforeunload = function() {
            if (formIsDirty(document.forms[1])) {
                return confirm('Unsaved changes. Do you want to continue?');
            }
        }
    </script>

<s:form id="editDataSource" name="editDataSource" theme="ajax"
        action="UpdateTagDataSource" method="POST">
...
</s:form>

   
</jsp:root>

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message