Project

General

Profile

Interesting behaviour with clicked() signal after updating to Wt-3.2.2-p1

Added by Ed Base over 12 years ago

Hello,

After updating to Wt-3.2.2-p1 one of the clicked() signals is not emitted.

It is interesting because only one clicked() signal is not working. It does not work only in Firefox. In Chromium in works fine. Also, if I bind mouseWentUp() instead, it works as expected in both browsers.

Seems silly, but I can't figure this out. Perhaps, the update worked on something related and it will ring a bell to somebody.

WTemplate *loginLinks = new WTemplate(tr("login-links"));

WText *loginLink = new WText(tr("login"));
loginLink->setStyleClass("link");
loginLink->clicked().connect(this, &AppImpl::showLoginDialog);
//loginLink->mouseWentUp().connect(this, &AppImpl::showLoginDialog);

loginLinks->bindWidget("login-link", loginLink);

Any suggestions how I could try to isolate the cause?

Regards


Replies (3)

RE: Interesting behaviour with clicked() signal after updating to Wt-3.2.2-p1 - Added by Koen Deforche over 12 years ago

Hey,

It's got to be something else affecting this, perhaps CSS or the template contents ?

Also, what version of Firefox are you using ? And do you see JavaScript errors in the error console ?

I couldn't reproduce it with the following test case:

#include <Wt/WApplication>
#include <Wt/WLabel>
#include <Wt/WPushButton>
#include <Wt/WContainerWidget>
#include <Wt/WText>
#include <Wt/WTemplate>
#include <iostream>

using namespace Wt;

class Test : public WApplication
{
public:
  Test(const WEnvironment& env) 
   : WApplication(env)
  {
    WTemplate *loginLinks = new WTemplate("${login-link}", root());

    WText *loginLink = new WText("login");
    loginLink->setStyleClass("link");
    loginLink->clicked().connect(this, &Test::foo);
    //loginLink->mouseWentUp().connect(this, &AppImpl::showLoginDialog);

    loginLinks->bindWidget("login-link", loginLink);
  }

  void foo() {
    std::cerr << "Got click" << std::endl;
  }
};

WApplication *createApplication(const WEnvironment& env){
  return new Test(env);
}

int main(int argc, char *argv[]){
  return WRun(argc, argv, createApplication);
}

Regards,

koen

RE: Interesting behaviour with clicked() signal after updating to Wt-3.2.2-p1 - Added by Ed Base about 12 years ago

Hello,

Apparently, the test code above produces unclickable link in Firefox (15.0) when application is run in progressive-bootstrap mode.

Regards

RE: Interesting behaviour with clicked() signal after updating to Wt-3.2.2-p1 - Added by Koen Deforche about 12 years ago

Hey,

Indeed so! I've fixed this in my git copy, and this will be part of 3.2.3

Thanks,

koen

    (1-3/3)