M - a model class that will be used for template data propagationpublic abstract class PolymerTemplate<M extends TemplateModel> extends AbstractTemplate<M>
JsModule annotation and the
components should be associated with the web component element using the
@Tag annotation.
You may use Id annotation inside your template class for a field to
reference an element inside your template via id attribute value. Note
that the injected element will have functional limitations on the server
side.
Recommend using LitTemplate instead of PolymerTemplate as Polymer
will be deprecated in the next LTS version.
JsModule,
Tag,
Id,
Serialized Form| Modifier | Constructor and Description |
|---|---|
|
PolymerTemplate()
Creates the component that is responsible for Polymer template
functionality.
|
|
PolymerTemplate(TemplateParser parser)
Creates the component that is responsible for Polymer template
functionality using the provided
parser. |
protected |
PolymerTemplate(TemplateParser parser,
VaadinService service)
Creates the component that is responsible for Polymer template
functionality using the provided
parser. |
| Modifier and Type | Method and Description |
|---|---|
Stream<Component> |
getChildren()
Gets the child components of this component.
|
getModel, getModelType, getModelType, getStateNode, initModel, isSupportedClassaddListener, fireEvent, from, get, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisibleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAttachListeneraddDetachListenerpublic PolymerTemplate(TemplateParser parser)
parser.parser - a template parserprotected PolymerTemplate(TemplateParser parser, VaadinService service)
parser.parser - a template parserservice - the related service instancepublic PolymerTemplate()
public Stream<Component> getChildren()
The default implementation finds child components by traversing each
child Element tree.
If the component is injected to a PolymerTemplate using the
@Id annotation the getChildren method will only return
children added from the server side and will not return any children
declared in the template file.
Please note that components defined using @Id are not child
components since they are attached inside the Shadow DOM. Only components
explicitly added through methods such as HasComponents.add(com.vaadin.flow.component.Component...) or
Node.appendChild(Element...) are returned by this method.
getChildren in class ComponentIdCopyright © 2025. All rights reserved.