Project

General

Profile

Actions

Bug #3098

closed

Bug with WLineEdit and addEventListener

Added by Alan Finley about 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
05/08/2014
Due date:
% Done:

0%

Estimated time:

Description

Here I want to use a custom line edit:

class MyEdit : public Wt::WLineEdit
{
public:
    MyEdit(Wt::WContainerWidget *parent = 0) :
        Wt::WLineEdit(parent)
    {
        doJavaScript(jsRef() +
                ".addEventListener('input', function() { console.log(\"input event\"); })");
    }
};

Wt::WApplication*
createApplication(const Wt::WEnvironment& env)
{
    Wt::WApplication *app = new Wt::WApplication(env);

    MyEdit *edit = new MyEdit;
    app->root()->addWidget(edit);

    return app;
}

When I load this app using Firefox 3.6.28 I get the 'loading' label in the top right corner and my app becomes unresponsive.

In the js console log I get this:

uncaught exception: [Exception... "Not enough arguments"  
nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)"  
location: "JS frame :: http://192.168.77.143:9097/wt?
wtd=LQOku4MYblhKT1mv&sid=-1194321923&tz=240&
deployPath=%2Fwt&request=script&rand=1172220759 :: anonymous :: line 260"  data: no]

In other browser (and in newer versions of FF) everything is ok.

I use Wt 3.3.1.

I don't know if this is Wt or Firefox bug :)

Actions #1

Updated by Koen Deforche almost 10 years ago

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche

Hey,

addEventListener() historically needs 3 parameters:

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener

Regards,

koen

Actions #2

Updated by Koen Deforche almost 10 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF