How can i do a List-Binding using LitElement and vaadin (On Java binding)


I want to know how can i do something like that (this is on poylmer, but i want to know how is on LitElement)

In my case i have on polymer, and i want to move to LitElement

<template is="dom-repeat" items="{{topPlays}}">
	<li class="play">{{}}
		<span class="amount">{{item.amount}}</span>

On my LitElement template i use

static get properties() {
        return {
            topPlays: {type: Array}

On java code i have using polymer

public interface ChartsPanelModel extends TemplateModel {
        void setTopPlays(List<TopPlay> topPlays);

How can i do on LitElement? i can’t use setAttribute on a Array or a List

Hi, you can check this [lit-html document]
( to see how to do repeating templates. has an example of setting an element property to a list of beans. It currently requires manual JSON conversion

If you want a client driven template (components and UI logic in template, data from the server), you should check out Vaadin 15 and Endpoints there. They allow you to do the same thing without any manual JSON conversion.