Hi all !
Found a solution which is quit generic. I think, there should be an easier solution; but I have to deliver ;/
@ViewComponent
private FormLayout form;
protected void onInit(InitEvent event) {
// all components of this form
List<Component> f = form.getChildren().toList();
for (Component component : f) {
// search in all components for the label
List<Component> l = component.getChildren().toList();
for (int c = 0; c < l.size(); c++) {
if (component.getElement().getChild(c).getAttribute("slot") != null &&
component.getElement().getChild(c).getAttribute("slot").equals("label")) {
component.getElement().getChild(c).setText("labelText");
}
}
}
There is more logic, as not all field labels will have the content labelText, but this is a solution how i could set the label on the <formItem>
Hopefully it is usefull for somebody.
Felix