Polymer paper-dialog

99 views
Skip to first unread message

Mateusz Lewandowski

unread,
Sep 13, 2016, 12:33:27 AM9/13/16
to Dart Misc
Hi.
I am new in dart and polymer technology.
In last days i have a problem with using paper-dialog.
I have wanna use it as an element on typical dart page but idee hast told me that it needed to be inside polymer element.
The goal is that i need to fire method from inside polymer element (now i know how to firing methods from such polymer elements) which show me the paper dialog with setted txt.
I have tried to use in my firing method the followin which had not effect:
1) this.open();
2)querySelector("somePaperDialogId").open();

How to open it using method?

Jonas Bojesen

unread,
Sep 13, 2016, 11:32:09 AM9/13/16
to Dart Misc
The open method should work like this. Things in the surroundings of the paper-dialog could affect the behavior, so hard to tell what is wrong.

For me good source of information is http://stackoverflow.com/tags/dart-polymer
Old, but I think the majority still valid https://github.com/dart-lang/polymer-dart-patterns
Maybe not that much activity, but this group is specific for web development in dart e.g. polymer. https://groups.google.com/a/dartlang.org/forum/#!forum/web

Jonas Bojesen

unread,
Sep 13, 2016, 11:32:09 AM9/13/16
to Dart Misc
Hi,

  The open method should work like this, so likely something in the surroundings of the paper-dialog element. Hard to tell without the full code.

For me this have been a good resource http://stackoverflow.com/tags/dart-polymer
Maybe a little old, but I think most still valid https://github.com/dart-lang/polymer-dart-patterns


tirsdag 13. september 2016 06.33.27 UTC+2 skrev Mateusz Lewandowski følgende:

Mateusz Lewandowski

unread,
Sep 13, 2016, 2:57:24 PM9/13/16
to mi...@dartlang.org
I can not still resolve my problem
I am getting error:
 Uncaught Unhandled exception:
The null object does not have a method 'open'.

NoSuchMethodError: method not found: 'open'
Receiver: null
here is my code
dart:
@CustomTag('messageinfo-element')
class MessageInfo extends PolymerElement {
@observable String message;

MessageInfo.created() : super.created();

void RunMessageInfo(String message)
{
this.message=message;

PaperDialog infos = this.querySelector("#dialog");
infos.open();
}
} html:
<polymer-element name="messageinfo-element">
<template>
<paper-dialog id="dialog" heading="Dialog Title">
<p>{{message}}</p>
</paper-dialog>
</template>
</polymer-element>



--
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+uns...@dartlang.org.

Doug Reese

unread,
Sep 13, 2016, 5:09:17 PM9/13/16
to Dart Misc
It looks like querySelector is failing.  Why the "this."?  When I do something similar, the code looks something like:

import 'dart:html' as html;

...

PaperDialog infos = html.querySelector("#dialog");
if (null != infos) {
  infos
.open();
} else {
 
// some kind of error handling
}

Doug

Jonas Bojesen

unread,
Sep 14, 2016, 3:04:06 AM9/14/16
to Dart Misc
It is local dom of the element. https://github.com/dart-lang/polymer-dart/wiki/local-dom

Another queryselector should be used 
Polymer.dom(parent).querySelector(selector)

Mateusz Lewandowski

unread,
Sep 22, 2016, 5:05:11 AM9/22/16
to mi...@dartlang.org
dom had not work for me.
I had used shadowroot and worked :)
thanks a lot for your responses which make me on the right way
Reply all
Reply to author
Forward
0 new messages