Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

How is that possible to keep a component required in readonly mode?

Flavio Santos
6 years ago May 28, 2015 3:35pm
dmitrii rogozin
6 years ago May 29, 2015 10:41am

I'm wondering why do you need to have required=true, for read-only field, meaning that user can't edit this field.
Let's say even if this read-only fields are filled from other part of the code, and let's you managed to set them required=true. And checking will fail, and the user will get a message that this field a mandatory, but he still can't edit them. So it's really a confusing behaviour. 
 If the required values are not coming from the user input, but from other place let's say database, you should check these values as soon as you get them.

If you want to change only the appearence of the field (adding an asterix to the required field) you should do this via css.

Flavio Santos
6 years ago May 29, 2015 11:10am