Project

General

Profile

Actions

Bug #966

closed

WResource + google Chrome combination -> Wt issue [Reproducible]

Added by Rob Van Dyck over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
08/23/2011
Due date:
% Done:

0%

Estimated time:

Description

Hi,

Downloading a file and clicking around while downloading gives issues on google Chrome. It works as expected on Firefox and IE.

On Chrome it shows a 'Loading' message that doesn't appear to go away anymore. Some widgets stop responding to click events untill a full reload. It appears the application is in an inconsistent state from that moment.

To see the output: check my attached screenshot resource_issue.png

To reproduce:

steps:

  1. Click 'Resource test'
  2. Within 5 seconds: click 'click me afterwards'

code:

<begin helloapplication.h>

class HelloApplication : public WApplication

{

...

WFileUpload *upload_;

WDialog *dialog_;

class test_resource : public WStreamResource{

public:

test_resource(WObject *parent = 0);

void handleRequest(const Http::Request& request,Http::Response& response);

};

}

<end helloapplication.h>

<begin helloapplication.cpp>

HelloApplication::test_resource::test_resource(WObject *parent)

: WStreamResource(parent)

{

suggestFileName("test.tgz");

}

void HelloApplication::test_resource::handleRequest(const Http::Request& request,Http::Response& response)

{

std::cout << "click between here\n";

sleep(5);

std::cout << "and here\n";

//response.out() << "123";

}

void HelloApplication::create()

{

this->enableUpdates(true);

dialog_ = new WDialog("Upload");

WPushButton *download = new WPushButton("Resource test", root());

test_resource *res = new test_resource(this);

download->setResource(res);

WPushButton *button = new WPushButton("click me afterwards", root());

button->clicked().connect(boost::bind(&HelloApplication::handle_response, this, true));

}

<end helloapplication.cpp>

I tried 2 different Chrome versions

1: 6.0.472.63 (59945) Built on Debian 6.0, running on Debian 6.0.2

  1. 13.0.782.215 (Windows XP)

Regards!

Rob.


Files

resource_issue.png (121 KB) resource_issue.png Rob Van Dyck, 08/23/2011 11:20 AM
Actions #1

Updated by Rob Van Dyck over 12 years ago

Forgot to add the method handle_response:

void HelloApplication::handle_response(bool available)

{

std::cout << "clicked!\n";

upload_ = new WFileUpload(dialog_->contents());

upload_->setFileTextSize(0);

dialog_->exec();

}

Actions #2

Updated by Koen Deforche over 12 years ago

  • Assignee set to Koen Deforche
  • Target version set to 3.1.11

Hey Rob,

I've seen this too. I believe it is related to the following comment in WAnchor documentation:

If you do not want the application to terminate when the user follows the anchor, you must use setTarget(TargetNewWindow).

But that method is not available (nor applicable) to WPushButton. To be investigated.

Regards,

koen

Actions #3

Updated by Rob Van Dyck over 12 years ago

I could work around this bug by linking the clicked signal to a Wanchor then?

As in:

http://thread.gmane.org/gmane.comp.web.witty.general/5544/focus=5588

Regards,

Rob

Actions #4

Updated by Koen Deforche over 12 years ago

Hey Rob,

Yes, that should work, and using setTarget().

Regards,

koen

Actions #5

Updated by Rob Van Dyck over 12 years ago

Ok, I'll work around the issue with a WAnchor that is hidden. Thanx!

Actions #6

Updated by Koen Deforche over 12 years ago

Hey Rob,

As I go over some refactoring in WResource, I realize that there may actually be another solution (I'll test it using your test case):

 response->setDisposition(WResource::Attachment);

Regards,

koen

Actions #7

Updated by Koen Deforche over 12 years ago

  • Status changed from New to Resolved

Hey Rob,

Only the TargetNewWindow trick seems to help. I've implemented this now also in WPushButton.

Regards,

koen

Actions #8

Updated by Koen Deforche over 12 years ago

  • Status changed from Resolved to Closed

Resolved in Wt 3.1.11

Actions

Also available in: Atom PDF