Hello everyone!
I’ve faced strange behavior of IntegerField in Selenium tests. (I’m using selenium ide chrome extension)
When I run my test, TextField’s new value is sent to server side, but IntegerField’s isn’t.
In ui IntegerField contains new value, but on server no valueChangeEvent is fired.
I hope, you will advice me some workaround. For now, I’ll use TextField with number only pattern.
@SuppressWarnings("serial")
@PageTitle("test")
@Route(value = TestView.ROUTE, layout = MainLayout.class)
@RolesAllowed({ UserRole.ADMIN })
public class TestView extends VerticalLayout {
private static final String ROUTE = "test";
public TestView() {
super();
setSizeFull();
setSpacing(false);
initComponents();
}
public void initComponents() {
IntegerField integerField = new IntegerField();
integerField.addValueChangeListener(e -> {
System.out.println(e.getValue());
});
TextField textField = new TextField("text");
textField.addValueChangeListener(e -> {
System.out.println(e.getValue());
});
add(textField, integerField, new TextField());
}
}