@Tag("my-component")
@HtmlImport("my-component.html")
public class MyComponent extends PolymerTemplate<MyComponent.Model> {
public static class Person {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
public static interface Model extends TemplateModel {
Person getPerson();
void setPerson(Person person);
}
public void setPerson(Person person) {
getModel().setPerson(person);
}
}
When setting the model object at the server-side, the received object at the client-side is empty at first (not null, but empty), and then after that the properties are populated. But even after the properties are set, the object is not quite the same as the Java counterpart - there's an extra nodeId property in the object, that wasn't part of the object in the server-side.
Given this
PolymerTemplate
:... and this template:
When setting the model object at the server-side, the received object at the client-side is empty at first (not
null
, but empty), and then after that the properties are populated. But even after the properties are set, the object is not quite the same as the Java counterpart - there's an extranodeId
property in the object, that wasn't part of the object in the server-side.A simple project showcasing the problem can be accessed here: https://github.com/gilberto-torrezan/flow-polymer-component
Issue reported by @tomasell via our Gitter channel https://gitter.im/vaadin-flow/Lobby