I'm working on a Maven, Vaadin with Designer and i can not resolve why my code is still showing me "test" and "test2" because through the testView2.setVisible(false) the "test2" label should be hidden. Here is all relevant code. Hope anyone can help.
TestView.java
@Tag("test-view")
@HtmlImport("src/views/kunde/test-view.html")
@Route("test")
public class TestView extends PolymerTemplate<TestView.TestViewModel> {
@Id("testView2")
private TestView2 testView2;
public TestView() {
testView2.setVisible(false);
}
public interface TestViewModel extends TemplateModel {
}
}
test-view.html
<dom-module id="test-view"> <template>
<style include="shared-styles">
:host {
display: block;
}
</style>
<div>
<label>Label</label>
</div>
<test-view-2 id="testView2"></test-view-2>
</template> <script>
class TestView extends Polymer.Element {
static get is() {
return 'test-view';
}
static get properties() {
return {
// Declare your properties here.
};
}
}
customElements.define(TestView.is, TestView);
</script> </dom-module>
test-view-2.html
<dom-module id="test-view-2">
<template>
<style include="shared-styles">
:host {
display: block;
}
</style>
<div>
<label>test2</label>
</div>
</template>
<script>
class TestView2 extends Polymer.Element {
static get is() {
return 'test-view-2';
}
static get properties() {
return {
// Declare your properties here.
};
}
}
customElements.define(TestView2.is, TestView2);
</script>
</dom-module>