Project

General

Profile

Actions

Bug #1293

closed

setInternalPath() triggers one extra internalPathChanged() signal in non-ajax session

Added by con abs almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
High
Assignee:
Target version:
Start date:
05/18/2012
Due date:
% Done:

0%

Estimated time:

Description

My app's logic:

  1. click a button
  2. change internal path to '/alice/'
  3. handlePathChange: append the text value of current internal path to the page
  4. as a result, the string '/alice/' will appear after the button.

Those works fine in ajax session.

But in non-ajax session, my app gets TWO internalPathChanged() signal, the 1st is handlePathChange( '/alice/' ), the 2nd is handlePathChange( '/' ), finally I get '/alice//' appended.

Code for reproduction:

#include <Wt/WContainerWidget>
#include <Wt/WPushButton>
#include <Wt/WText>

using namespace Wt;

class MyApp : public WApplication
{
public:

    MyApp(const WEnvironment& env)
        : WApplication(env)
    {
        WPushButton* button = new WPushButton( "click to see alice", root() );
        button->clicked().connect( this, &MyApp::changePath );
        internalPathChanged().connect( this, &MyApp::handlePathChange );
    }

    void changePath() { setInternalPath( "/alice/", true ); }

    void handlePathChange( std::string path )
    {
        std::cout << "handlePathChange " << path << std::endl;
        new WText( path, root() );
    }
};

WApplication *createMyApplication(const WEnvironment& env)
{
    return new MyApp(env);
}

int main(int argc, char **argv)
{
    return WRun(argc, argv, &createMyApplication);
}
Actions #1

Updated by Koen Deforche almost 12 years ago

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche
  • Target version set to 3.2.2

Hey,

This has been fixed in git.

Regards,

koen

Actions #2

Updated by con abs almost 12 years ago

Да здравствует!

Actions #3

Updated by Koen Deforche almost 12 years ago

  • Status changed from Resolved to Closed

Released in Wt 3.2.2

Actions

Also available in: Atom PDF