QAjaxAction redirect shows xml in IE6

thread: 6 messages  |  last: a year ago  |  started: tuesday, june 1, 2010, 3:14 am pdt


#1  |  KevinP (Nottingham, UK) United Kingdom
Tuesday, June 1, 2010, 3:14 AM PDT

Hi

I've been working on a project that uses ajax actions heavily to allow redirects, show QPanels etc.

Everything works very well, however some users are having problems with IE6 (version 6.0.2900.2180 on XP SP2). I've tested in a local version of IE6 but can't replicate the problem.

As an example, on a simple login page the user logs in, the login is recorded, and a QApplication::Redirect is called when successful. The login button uses a QAjaxAction. The result is a successful redirect, but the user is shown the XML code in their browser instead of actually being redirected.

For other QAjaxAction calls, for instance when trying to show a QPanel, nothing happens at all.

Has anyone had this problem before? It appears that some of the ajax action is being executed, but the browser isn't behaving. Could this be a potential browser setting? I haven't noticed anything that could be causing this.

I'm using QCodo version 0.4.14.

Any help is very much appreciated.

Thanks,
Kev

#2  |  Patrick Ranger (Montreal, Qc) Canada
Tuesday, June 1, 2010, 7:46 AM PDT

I had the same problem a while ago and I think that my problem was the file header being sent. You might want to check on the process flow and see what's being sent to the browser...

However I am not sure that an Ajax action has much added value when redirecting, since you will be sending a whole new page anyways. Any reason for picking QAjaxAction for redirecting?

Patrick

#3  |  KevinP (Nottingham, UK) United Kingdom
Tuesday, June 1, 2010, 8:48 AM PDT

Hi Patrick,

I've used firebug to check the response being sent during the login example I've previously given. The only thing returned is the xml code, and that's being shown in the browser instead of triggering a redirect.

As you've stated, for a redirect there's no reason for not using a QServerAction, so I've resolved my issue by using QServerAction in all the places that I'm having a problem.

Unfortunately, that includes some points were a QPanel or QDialogBox is shown, which isn't so great. It works for now but I'll continue testing and post any useful information here.

Thanks
Kev

#4  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Tuesday, June 1, 2010, 9:01 AM PDT

Not sure if this will help, but usually an XML response appears when there is an QAjaxAction triggered simultaneously with a form Submit.

Note that some browsers will actually implicitly call a Submit on a form if, for example, you hit the “Enter” key in a textbox if the textbox is the only control in the form.

This is why we have things like QTerminateAction().  If you have just a single text box that triggers an ajaxaction on a qenterkeyevent, it is always recommended that you add a QTerminateAction() so that it will guarantee that the browser doesn't do an implicit form submit:

    $this->txtMyTextbox->AddAction(new QEnterKeyEvent(), new QAjaxAction('txtMyTextbox_Enter'));
    $this->txtMyTextbox->AddAction(new QEnterKeyEvent(), new QTerminateAction());

Again, I'm not sure how your form(s) are set up, so I don't know if this applies to you at all, but I thought I'd share this to see if it will help.

#5  |  KevinP (Nottingham, UK) United Kingdom
Wednesday, June 2, 2010, 8:54 AM PDT

Hi Mike

Thanks for the advice. I'd totally forgotten about QTerminateAction()!

I've been trying to replicate the issue myself (it's a client that's having the problem). If I add a QJavascriptAction to call the Submit it forces the error, but this won't help me if I'm trying to fix it with a QTerminateAction().

There are some secondary issues where I'm using QLabels to act as links so that I can do a few things before redirecting. Also some problems with showing QPanels using QAjaxAction on a QButton.

Do you know of a specific setup that will allow me to recreate this issue. My test system with WinXP SP2 and IE6 doesn't show this issue.

Thanks
Kev

#6  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Friday, June 4, 2010, 12:30 AM PDT

i guess i'm a bit confused as to when you say “recreate this issue”?

Are you saying the client is having issues on his/her browser?  But you're not seeing the same issue on your browser, hitting the exact same server with the exact same browser vendor and version?



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.