use of com.vaadin.flow.component.textfield.BigDecimalField in project flow-components by vaadin.
the class ValueChangeModePage method initView.
private void initView() {
message = new Div();
message.setId("message");
add(message);
Stream.of(new TextField(), new TextArea(), new PasswordField(), new NumberField(), new EmailField(), new IntegerField(), new BigDecimalField()).forEach(this::setupTestComponent);
}
use of com.vaadin.flow.component.textfield.BigDecimalField in project flow-components by vaadin.
the class HasLabelTest method bigDecimalField.
@Test
public void bigDecimalField() {
BigDecimalField c = new BigDecimalField();
Assert.assertTrue(c instanceof HasLabel);
}
use of com.vaadin.flow.component.textfield.BigDecimalField in project furms by unity-idm.
the class DashboardResourceAllocateFormView method amountField.
private BigDecimalField amountField() {
final BigDecimalField amountField = new BigDecimalField();
amountField.setValueChangeMode(EAGER);
amountField.setReadOnly(!binder.getBean().getResourceCredit().split);
createUnitLabel(amountField, binder.getBean().getResourceType().unit);
binder.forField(amountField).withValidator(Objects::nonNull, getTranslation("view.fenix-admin.resource-credits-allocation.form.error.validation.field.amount")).withValidator(this::isAmountCorrect, getTranslation("view.fenix-admin.resource-credits-allocation.form.error.validation.field.amount.range")).bind(CommunityAllocationViewModel::getAmount, CommunityAllocationViewModel::setAmount);
amountField.setValue(availableAmount);
return amountField;
}
use of com.vaadin.flow.component.textfield.BigDecimalField in project furms by unity-idm.
the class ProjectAllocationDashboardFormView method amountField.
private BigDecimalField amountField() {
final BigDecimalField amountField = new BigDecimalField();
amountField.setValueChangeMode(EAGER);
Optional<AllocationCommunityComboBoxModel> communityAlloc = Optional.ofNullable(binder.getBean().getAllocationCommunity());
amountField.setReadOnly(!communityAlloc.map(alloc -> alloc.split).orElse(true));
createUnitLabel(amountField, binder.getBean().getResourceType().unit);
binder.forField(amountField).withValidator(Objects::nonNull, getTranslation("view.community-admin.project-allocation.form.error.validation.field.amount")).withValidator(this::isAmountCorrect, getTranslation("view.community-admin.project-allocation.form.error.validation.field.amount.range")).bind(ProjectAllocationViewModel::getAmount, ProjectAllocationViewModel::setAmount);
amountField.setValue(availableAmount);
return amountField;
}
use of com.vaadin.flow.component.textfield.BigDecimalField in project flow-components by vaadin.
the class BigDecimalFieldTest method init.
@Before
public void init() {
field = new BigDecimalField();
field.setLocale(Locale.US);
}
Aggregations