Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Events in Dart Polymer not working #19821

Closed
DartBot opened this issue Jul 3, 2014 · 6 comments
Closed

Custom Events in Dart Polymer not working #19821

DartBot opened this issue Jul 3, 2014 · 6 comments
Labels
needs-info We need additional information from the issue author (auto-closed after 14 days if no response)

Comments

@DartBot
Copy link

DartBot commented Jul 3, 2014

This issue was originally filed by TBiesem...@gmail.com


What steps will reproduce the problem?

  1. A sample is attached. There are two polymer elements, my-parentnode and my-childnode. The parent contains the child:

<polymer-element name="my-parentnode">
    <template>
        <div>Parent</div>
       <my-childnode on-childClicked="{{childClicked}}"> </my-childnode>
    </template>
    <script type="application/dart" src="parentNode.dart">
    </script>
</polymer-element>

When the user clicks on the my-childnode, a custom event is being raised by the childnode:

  void click(Event e, var details, Node target){
    print("click evetn from child");
    this.fire('childClicked');
  }

The parent has registered to the custom event from the child:
on-childClicked="{{childClicked}}

  void childClicked(Event e, var details, Node target){
    print("Parent: childClicked");
  }

What is the expected output? What do you see instead?
My expectation is that the childClicked method of the parentnode will be called, but this does not work.

What version of the product are you using? On what operating system?
Win7 Dartium 36.0.1985.67 (277752) DartSDK 1.5 Polymer 0.11 +5

Thanks and regards,
Thomas


Attachment:
eventsample.zip (1.58 KB)

@DartBot
Copy link
Author

DartBot commented Jul 3, 2014

This comment was originally written by @zoechi


I use custom events a lot and didn't have such issues. I only used lowercase like child-clicked so far.

@dgrove
Copy link
Contributor

dgrove commented Jul 7, 2014

Added Pkg-Polymer, Triaged labels.

@sigmundch
Copy link
Member

I have the same question as @­gzoechi. Does it work if you use all lower case letters and dashes by any chance (on-click-clicked)?

HTML attributes are case insensitive, so I would't be surprised if there are issues with case sensitivity.

@sigmundch
Copy link
Member

Removed Priority-Unassigned label.
Added Priority-Medium, PolymerMilestone-Next, NeedsInfo labels.

@DartBot
Copy link
Author

DartBot commented Jul 9, 2014

This comment was originally written by TBies...@gmail.com


That did the trick.
Custom events must not contain upper case characters.
If i use only lower case, the event registration works as expected.
Did i miss some documentation?

@DartBot DartBot added Type-Defect needs-info We need additional information from the issue author (auto-closed after 14 days if no response) labels Jul 9, 2014
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/polymer-dart#226.

@DartBot DartBot closed this as completed Jun 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info We need additional information from the issue author (auto-closed after 14 days if no response)
Projects
None yet
Development

No branches or pull requests

3 participants