Actions
Bug #3098
closedBug with WLineEdit and addEventListener
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 :)
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
Updated by Koen Deforche almost 10 years ago
- Status changed from Resolved to Closed
Actions