I implemented a PolymerTemplate as the RouteLayout. In the implementation, I would like to add a custom component to the body, which is UI. The code is “UI.getCurrent().getElement.inertChild(0, component);”. However, that custom component was not inserted under body in the end. Any advice of how to correct that?
@Tag("logon-layout")
@HtmlImport(".....")
public class LogonLayout extends PolymerTemplate<TemplateModel> implement RouteLayout {
public LogonLayout {
UI.getCurrent().getElement.inertChild(0, new Html("<div>.....</div>"));
.....
}
}
After starting up, I found that the dom element for that Html didn’t get deployed, while others in polymertemplate did get deployed well. I also tried your suggestion to insertChild, but it failed as well. Instead, I used modifyBootstrapPage of BootstrapListener to insert node, and it worked.