Re: Struts2 + Dojo 0.4 + unbeforeunload problem

2008-09-12 Thread Pablo Vázquez Blázquez
dojo.connect does not exist in dojo 0.4 :( And separateScritpts attribute neither does in struts 2.0.9. Jeromy Evans escribió: Pablo Vázquez Blázquez wrote: Using dojo.addOnUnload(function) neither works. Besides that, I would need sht like dojo.addOnBeforeUnload, but it does not exist. I

Re: Struts2 + Dojo 0.4 + unbeforeunload problem

2008-09-12 Thread Pablo Vázquez Blázquez
script type=text/javascript var form = document.forms[0]; if ((form) amp;amp; (formIsDirty(form))) { var a = confirm(There are unsaved changes. Do you want to continue?); if (!a) { dojo.event.topic.publish(/cancelNavigation); //HOW TO CANCEL NAVIGATION??

Re: Struts2 + Dojo 0.4 + unbeforeunload problem

2008-09-12 Thread Jeromy Evans
I don't really know as i don't use dojo or the ajax tags for any more for all the same reasons you're experiencing. Dojo's event model is based on AOP concepts; which allows you to bind functions to the event, before the event or after the event. So you need a listener attached to before the

Re: Struts2 + Dojo 0.4 + unbeforeunload problem

2008-09-11 Thread Pablo Vázquez Blázquez
No idea or miss-explanation? Thanks. Pablo Vázquez Blázquez escribió: 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.

Re: Struts2 + Dojo 0.4 + unbeforeunload problem

2008-09-11 Thread Jeromy Evans
Pablo Vázquez Blázquez wrote: No idea or miss-explanation? Use dojo's event model. You need to register a listener/subscriber for the event via dojo. If you assign a listener directly to onbeforeunload or onload you'll overwrite the listeners that dojo needs to assign (or vice-versa, dojo

Re: Struts2 + Dojo 0.4 + unbeforeunload problem

2008-09-11 Thread Pablo Vázquez Blázquez
Using dojo.addOnUnload(function) neither works. Besides that, I would need sht like dojo.addOnBeforeUnload, but it does not exist. I don´t think I should subscribe for an ajax-request-completion event, but for the beforeunload one, don´t I? Thanks. Jeromy Evans escribió: Pablo Vázquez

Re: Struts2 + Dojo 0.4 + unbeforeunload problem

2008-09-11 Thread Owen Berry
Javascript within a remote div is not evaluated by default. Not sure about s:div, but sx:div has executeScripts which must be set to true. Owen On Fri, Sep 5, 2008 at 6:01 AM, Pablo Vázquez Blázquez [EMAIL PROTECTED] wrote: Hi!! If I have the following code in a jspx loaded via s:div, when I

Re: Struts2 + Dojo 0.4 + unbeforeunload problem

2008-09-11 Thread Pablo Vázquez Blázquez
I have executeScripts=true in my s:div tag. Thanks. Owen Berry escribió: Javascript within a remote div is not evaluated by default. Not sure about s:div, but sx:div has executeScripts which must be set to true. Owen On Fri, Sep 5, 2008 at 6:01 AM, Pablo Vázquez Blázquez [EMAIL PROTECTED]

Re: Struts2 + Dojo 0.4 + unbeforeunload problem

2008-09-11 Thread Jeromy Evans
Pablo Vázquez Blázquez wrote: Using dojo.addOnUnload(function) neither works. Besides that, I would need sht like dojo.addOnBeforeUnload, but it does not exist. I don´t think I should subscribe for an ajax-request-completion event, but for the beforeunload one, don´t I? Thanks. Use the

Struts2 + Dojo 0.4 + unbeforeunload problem

2008-09-05 Thread Pablo Vázquez Blázquez
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