Closed alejandro-du closed 3 years ago
Version 4.6.0 includes the new functionality. Usage example:
DefaultCrudFormFactory<User> formFactory = new DefaultCrudFormFactory<User>(User.class) {
@Override
protected void configureForm(FormLayout formLayout, List<HasValueAndElement> fields) {
Component nameField = (Component) fields.get(0);
formLayout.setColspan(nameField, 2);
}
};
Works great for me, thank you!
On second thoughts, the configureForm method is called for all operations, be they findAll, add or delete. But typically in the delete form you won't have the same fields as in the add form, so accessing the fields by index will yield different results. Also, you might want to have colspan=2 in the add form, but not in the delete form, whereas in the findAll you would like to skip everything, because you're in a grid and not in a form.
From https://vaadin.com/forum/thread/14437640/crud-ui-add-on?page=5: