You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clicking button in Details will cause JavaScript exception on console #2727
masterdetail:6 There seems to be an error in Vaadin Grid:
Unexpected value for section: details
Please submit an issue to https://github.com/vaadin/flow-components/issues/new/choose
console.error @ masterdetail:6
eval @ FlowBootstrap.js?f80c:67
_onContentFocusIn @ vaadin-grid-keyboard-navigation-mixin.js?709a:734
Code to reproduce
@PageTitle("Master-Detail") @route(value = "masterdetail")
public class MasterDetailView extends Div {
private Grid<Vector<String>> grid = new Grid<>();
public MasterDetailView() {
setSizeFull();
// Configure Grid
grid.addColumn(item -> item.get(0)).setAutoWidth(true);
grid.addColumn(item -> item.get(1)).setAutoWidth(true);
grid.setItems(createData());
grid.addThemeVariants(GridVariant.LUMO_NO_BORDER);
grid.setHeightFull();
grid.setItemDetailsRenderer(createPersonDetailsRenderer());
add(grid);
}
private List<Vector<String>> createData() {
Random rand = new Random();
return IntStream.range(0, 20).mapToObj(i -> {
Vector<String> vector = new Vector<>(2);
vector.add("email" + i + "@domain.com");
vector.add("" + rand.nextInt(20));
return vector;
}).collect(Collectors.toList());
}
private ComponentRenderer<PersonDetailsFormLayout, Vector<String>> createPersonDetailsRenderer() {
return new ComponentRenderer<>(PersonDetailsFormLayout::new, PersonDetailsFormLayout::setPerson);
}
private class PersonDetailsFormLayout extends VerticalLayout {
private final TextField emailField = new TextField("Email address");
private final TextField phoneField = new TextField("Phone number");
public PersonDetailsFormLayout() {
Stream.of(emailField, phoneField).forEach(field -> {
add(field);
});
Button btn = new Button("do it");
btn.addClickListener(e -> {
Notification.show("clicked");
});
add(btn);
}
public void setPerson(Vector<String> person) {
emailField.setValue(person.get(0));
phoneField.setValue(person.get(1));
}
}
Activity
darmro commentedon Feb 28, 2022
tomivirkki commentedon Feb 28, 2022
This is a regression from #822
The connector expects the
eventContext.sectionto be one ofheader,body,footer. If the section isdetails(also a valid value for the event context section), an exception is manually thrown.