Discussion:
[dart-misc] value of selected item in core menu in dart
Mateusz Lewandowski
2016-06-07 17:41:20 UTC
Permalink
Hi.
i have a problem with core-menu in dart.
I create polymer element with core menu

<polymer-element name="menu-element">
<template>
<core-menu selected="0" on-core-select="{{SelectItem}}">
<core-item icon="dialog" label="Ogłoszenia"></core-item>
<core-item icon="settings" label="Logowanie"></core-item>
<core-item icon="search" label="Rejestracja"></core-item>
</core-menu>
</template>
</polymer-element>


I need to send to SelectItem function, selected item in my menu.

Here is my code:


class Menu extends PolymerElement {
Menu.created() : super.created();

void SelectItem(dom.CustomEvent e)
{
var detail = new js.JsObject.fromBrowserObject(e)['detail'];
if(detail['isSelected']) {
// var item = (detail['item'] as CoreItem);
print(detail['item'].label);

}
}
}


My approach does not work and my question is, how to send selected item value to function?
--
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.
Günter Zöchbauer
2016-06-08 12:21:02 UTC
Permalink
Event bindings are without `{{}}` it should be

on-core-select="SelectItem">
Post by Mateusz Lewandowski
Hi.
i have a problem with core-menu in dart.
I create polymer element with core menu
<polymer-element name="menu-element">
<template>
<core-menu selected="0" on-core-select="{{SelectItem}}">
<core-item icon="dialog" label="Ogłoszenia"></core-item>
<core-item icon="settings" label="Logowanie"></core-item>
<core-item icon="search" label="Rejestracja"></core-item>
</core-menu>
</template>
</polymer-element>
I need to send to SelectItem function, selected item in my menu.
class Menu extends PolymerElement {
Menu.created() : super.created();
void SelectItem(dom.CustomEvent e)
{
var detail = new js.JsObject.fromBrowserObject(e)['detail'];
if(detail['isSelected']) {
// var item = (detail['item'] as CoreItem);
print(detail['item'].label);
}
}
}
My approach does not work and my question is, how to send selected item value to function?
--
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.
James Hurford
2016-06-08 18:20:09 UTC
Permalink
Are you sure about that Gunter? This looks like Polymer 0.16, which would create event bindings using {{}}. I think we need further information, like what version of Polymer, what browsers you've tried this in, as in have you tried running it in Dartium, which I assume you have? And also any output in the browser console window would be useful.
--
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.
Mateusz Lewandowski
2016-06-08 19:24:08 UTC
Permalink
It worked with {{}}
Yes it is Polymer 0.16
Post by James Hurford
Are you sure about that Gunter? This looks like Polymer 0.16, which would
create event bindings using {{}}. I think we need further information, like
what version of Polymer, what browsers you've tried this in, as in have you
tried running it in Dartium, which I assume you have? And also any output
in the browser console window would be useful.
--
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
--
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.
Günter Zöchbauer
2016-06-08 19:47:32 UTC
Permalink
Sorry, didn't recognize. I assumed Polymer 1.0.0-rx
Post by Mateusz Lewandowski
It worked with {{}}
Yes it is Polymer 0.16
Post by James Hurford
Are you sure about that Gunter? This looks like Polymer 0.16, which would
create event bindings using {{}}. I think we need further information, like
what version of Polymer, what browsers you've tried this in, as in have you
tried running it in Dartium, which I assume you have? And also any output
in the browser console window would be useful.
--
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
--
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.
Loading...