Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirm never updates page in FF #31

Open
joostschouten opened this issue Jul 28, 2011 · 2 comments
Open

Confirm never updates page in FF #31

joostschouten opened this issue Jul 28, 2011 · 2 comments

Comments

@joostschouten
Copy link

In firefox the confirm works good on ajax updates but not if the underlying link updates the whole page. Chrome works well. This is due to the following (see arrows):

function doAction() {
            if ($T(element).hasAction) {
                element.fire(Tapestry.ACTION_EVENT, capturedClickEvent);
                return;
            }

            /*
             * Is it a submit element (i.e., it has a click() method)? Try that
             * next.
             */

            if (element.click) {
                interceptClickEvent = false;

                element.click();
                return;             <--------!! This return prevents the window.location = element.href; from being reached !!
            }

            /*
             * Not a zone update, so just do a full page refresh to the
             * indicated URL.
             */
            window.location = element.href;
    }

Any reason why the return is there? Without it all seems to work for me.

This patch did the trick for me:

From b7854105325f4d9078aaa8e5ca9de35a617aafa3 Mon Sep 17 00:00:00 2001
From: Joost Schouten <***@jsportal.com>
Date: Thu, 28 Jul 2011 12:33:11 +0200
Subject: [PATCH] bugfix: removed the return statement from the doAction which was preventing a full page refresh in FF4

---
 .../com/howardlewisship/tapx/core/tapx.js          |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/tapx-core/src/main/resources/com/howardlewisship/tapx/core/tapx.js b/tapx-core/src/main/resources/com/howardlewisship/tapx/core/tapx.js
index d036984..4a11465 100644
--- a/tapx-core/src/main/resources/com/howardlewisship/tapx/core/tapx.js
+++ b/tapx-core/src/main/resources/com/howardlewisship/tapx/core/tapx.js
@@ -373,7 +373,6 @@ Tapx.extendInitializer(function() {
                interceptClickEvent = false;

                element.click();
-               return;
            }

            /*
-- 
1.6.4.1
@hlship
Copy link
Owner

hlship commented Jul 28, 2011

I thought I had manually tested that. The return is there because the element.click() call is expected to re-invoke this method (as the listener for the click event) and on the second pass drop down to window.location assignment. I'll recheck if this works for me ... I probably was testing in Chrome. If you remove the "return" statement, I believe it will break the Ajax use case. Sometimes I hate HTML.

@joostschouten
Copy link
Author

I had the problem with FF5.0.1. Without the return my usecases work for ajax and non ajax in FF5, chrome, IE7,8,9. But now you mention it, I did seem to have a problem in IE i needed to investigate where sometimes I got exceptions indicating I was deleting an already deleted item (confirm on delete). Which could indicate a double call which might be related to the second invocation not quite working as it should without the return. I'll dive into it a bit more. Looking forward to hearing your findings as well. And I agree, cross browser stuff is not my favorite activity ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants