Mateusz Lewandowski
2016-09-25 20:46:22 UTC
Hi.
i have a problem with add on click event listener on dynamicly loaded html
( on button click)
When i am trying to listen on click event the error occurs.
"Uncaught Unhandled exception:
The null object does not have a getter 'onClick'."
I have the following
Logon logon=new Logon();
DivElement div = querySelector('#MainContent');
EventListener HandleEvent(event)// async
{
switch(event.detail) {
case 'Logowanie':
{
HttpRequest.getString("logon.html").then((resp) {
div.append(new Element.html(resp));
});
div.querySelector("#login").onClick.listen((e) {
print("Loading...");
logon.LoginMethod();
});
break;
}
}
}
main() async{
document.addEventListener('todochange',HandleEvent);
...
}
I have tried different ways with no result.
Please help me with this.
i have a problem with add on click event listener on dynamicly loaded html
( on button click)
When i am trying to listen on click event the error occurs.
"Uncaught Unhandled exception:
The null object does not have a getter 'onClick'."
I have the following
Logon logon=new Logon();
DivElement div = querySelector('#MainContent');
EventListener HandleEvent(event)// async
{
switch(event.detail) {
case 'Logowanie':
{
HttpRequest.getString("logon.html").then((resp) {
div.append(new Element.html(resp));
});
div.querySelector("#login").onClick.listen((e) {
print("Loading...");
logon.LoginMethod();
});
break;
}
}
}
main() async{
document.addEventListener('todochange',HandleEvent);
...
}
I have tried different ways with no result.
Please help me with this.
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.