use of com.vaadin.flow.component.textfield.IntegerField in project flow-components by vaadin.
the class AbstractItemCountComboBoxPage method initEstimateOptions.
private void initEstimateOptions() {
menuBar.add("Item Count Estimate Configuration");
itemCountEstimateInput = new IntegerField("setItemCountEstimate", event -> comboBox.getLazyDataView().setItemCountEstimate(event.getValue()));
itemCountEstimateInput.setId(ITEM_COUNT_ESTIMATE_INPUT);
itemCountEstimateInput.setWidthFull();
itemCountEstimateIncreaseInput = new IntegerField("setItemCountEstimateIncrease", event -> comboBox.getLazyDataView().setItemCountEstimateIncrease(event.getValue()));
itemCountEstimateIncreaseInput.setId(ITEM_COUNT_ESTIMATE_INCREASE_INPUT);
itemCountEstimateIncreaseInput.setWidthFull();
menuBar.add(itemCountEstimateInput, itemCountEstimateIncreaseInput);
}
use of com.vaadin.flow.component.textfield.IntegerField in project testbench by vaadin.
the class ComponentQueryTest method withValue_matchingValue_findsComponent.
@Test
void withValue_matchingValue_findsComponent() {
Element rootElement = getCurrentView().getElement();
TextField targetField = new TextField();
String targetValue = "expected value";
targetField.setValue(targetValue);
rootElement.appendChild(targetField.getElement());
TextField otherField = new TextField();
otherField.setValue("Another value");
int targetNumericValue = 33;
IntegerField numericField = new IntegerField();
numericField.setValue(targetNumericValue);
rootElement.appendChild(otherField.getElement());
rootElement.appendChild(numericField.getElement());
rootElement.appendChild(new TextField().getElement());
Assertions.assertSame(targetField, $(Component.class).withValue(targetValue).first().getComponent());
Assertions.assertSame(numericField, $(Component.class).withValue(targetNumericValue).first().getComponent());
}
Aggregations