0

I try to create a vaadin component with polymer. I have used vaadin/flow-spring-tutorial as starting point. But I don't understand how to edit a template.

The template looks like this:

<!-- Defines the example-template element -->
<dom-module id="example-template">
    <template>
        <span>[[message]]</span>
    </template>

    <!-- Polymer boilerplate to register the example-template element -->
    <script>
        class ExampleTemplate extends Polymer.Element {
            static get is() {
                return 'example-template'
            }
        }
        customElements.define(ExampleTemplate.is, ExampleTemplate);
    </script>
</dom-module>

When I edit something. E.g.

 <span>[[message]]!!TEST</span

It doesn't has any effect after restarting the embedded webserver. The output is still

Hello from bean org.vaadin.spring.tutorial.Greeter@xxxxx

There is no directory that contains a compiled or cached version of this template and I don't know what I have to do to make the change take effect.

kfaria
  • 307
  • 2
  • 13
  • Can you post the vaadin class? Does the class and its TemplateModel have getter and setter for the message as it is done in [this documentation](https://github.com/vaadin/flow-and-components-documentation/blob/master/documentation/polymer-templates/tutorial-template-list-bindings.asciidoc#populating-the-list-of-items)? – kscherrer Feb 14 '19 at 16:55
  • The binding works obviously, because Hello from * is printed. But I don't know wich maven targets I have to execute after I edited a template. – kfaria Feb 15 '19 at 09:29
  • ah, I think I misunderstood your question at first. There shouldn't be a maven goal to execute for the changes to apply - restarting the server should result in the new template being used. Can you open the developer tools in your browser and look at the sources tab? there you should see your frontend folder with your template in it - is that template there the updated one? – kscherrer Feb 15 '19 at 09:53
  • Today it's working. I used the wrong route (/view) that prints the greeting without using the template. / is the right route to view the template. But I don't understand where the frontend directory is coming or what the actual build-process is and when to use production mode (this one creates a frontend directory in the target directory) – kfaria Feb 15 '19 at 10:46
  • Is this question still open or did you find a solution in the meanwhile? – Simon Martinelli Jun 03 '20 at 15:38

0 Answers0