Project

General

Profile

Bug #3977

Problems with closing a dialog after WServer::post

Added by Alan Finley about 7 years ago. Updated about 7 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/13/2015
Due date:
% Done:

0%

Estimated time:

Description

I have a dialog that contains a link to some resource. I want the dialog to be closed after the resource is downloaded.

Here's my resource code:

void MyResource::handleRequest(const Wt::Http::Request &request, Wt::Http::Response &response)
{
    ...
    _finished.emit();
}

Wt::Signal<>& MyResource::finished()
{
    return _finished;
}

And this is how I use it in my dialog:

...
resource = new MyResource(this);
resource->finished().connect(this, &MyDialog::onExportFinished);
...

void MyDialog::onExportFinished()
{
    Wt::WServer::instance()->post(sessionId, // <- session id is saved in the dialog ctor
                        boost::bind(&MyDialog::closeDialog, this));
}

void MyDialog::closeDialog()
{
    accept();
    wApp->triggerUpdate();
}

My web application class is based on WQApplication and has enableUpdates set to true.

The problem is that the dialog is not closed in Firefox. Other browser does not have problems with it.

Am I doing something wrong?

Also available in: Atom PDF