It should be at least possible to change the text value from server side Java code, by expecting to replace the contents completely, including any children it might have.
For parsing the initial text value, it is only supported when the element has no child elements, but just text content.
@Id("link") RouterLink link;
link.getText(); // returns "This is a router link"
link.setText("Another text value"); // would replace any children it has
If replacing children is not desired, it is recommended to workaround that by using another wrapper element for the text
<a routerlink id="link"><iron-icon icon="vaadin:vaadin-h"></iron-icon><span id="link-text">Link with icon</span></a>
@Id("link-text") Span linkText;
linkText.setText("At least this is possible to do");
Given a template with contents
It should be at least possible to change the text value from server side Java code, by expecting to replace the contents completely, including any children it might have. For parsing the initial text value, it is only supported when the element has no child elements, but just text content.
If replacing children is not desired, it is recommended to workaround that by using another wrapper element for the text