In a DatePicker in Vaadin Flow, how to get the invalid value?

75 Views Asked by At

I really need the invalid field value ("today", "last week monday" etc) in the DatePicker (https://vaadin.com/docs/latest/components/date-picker).

How is it possible to retrieve the arbitrary text in a DatePicker field?

enter image description here


After asking question I found this, but not sure if there a better way:


submitDate.getElement().executeJs("return this.inputElement.value;"
            ).then(value -> {
                String val = value.asString();
                
                // do whatever you need with 'val'
            });

0

There are 0 best solutions below