vaadil 14 DatePicker setRequired not working

how to use DatePicker setRequired?

Please describe your problem more. What did not work? What did you try? What did you expect? Did you use binder or not?

unknown.png

i need from to (*) Required field.

It already looks required.

it is not working .any example?

Please describe your problem more. What did not work? What did you try? What did you expect? Did you use binder or not?

it is in vaadin 8 screen working fine how to use in vaadin 14 .Datepicker.setRequired(true) it is not showing red color (*)…

It’s by default not red in V10. Additionally you can call “setRequiredIndicatorVisible(true)”

change the color to red…

You have to fiddle yourself with it. I can’t help with v14. With v23 you can apply the css property --lumo-required-field-indicator-color: red;

ok tank u

I was trying various options like ```:host [part~=‘required-indicator’] {
/* Add your CSS styles here, for example: */
background: red;
color: red;
}

[part=“label”]::after {
color: var(–lumo-primary-color-30pct);
}

:host([invalid]) [part=“label”]::after {
color: var(–lumo-error-color);
}```

But this single line gave me the solution. Thanks @quirky-zebra