CSS for readonly textfield

Hi,
I want to know,is it possible to give the border for textfield when it is in the read only mode ?( If I use textfield in the readonly mode,the borders of it get invisible which I dont want to happen )
If possible please do help me out with the CSS.I tried giving border using CSS but its not working.

Thanks in advance :slight_smile:

If you want every readonly texfield having a textfield it should look something like this:

.v-textfield-readonly{ border: 1px solid #bcbdbe !important; } If you want to just change one you can just use a custom descriptor (like .mytextfield .v-textfield-readonly{} ) and use setStyleName(“mytextfield”) [untested]

Thanku so much…The first CSS is working :slight_smile:

hi
can u help me?
https://vaadin.com/forum#!/thread/7879616/7879615

Hi,
If I use the custom descriptor

"(like .mytextfield .v-textfield-readonly{} ) and use setStyleName(“mytextfield”) "


for CSS of particular readonly field,it is not showing any effect.
Can you please help me out.

I hav used css as below
.mytextfield .v-textfield-readonly{
border: 1px solid #bcbdbe !important;
}
and setStyleName(“mytextfield”);

Thanks in advance.

Sorry when i wrote this i didn’t have an IDE to test it.
The correct selector should be:
.mytextfield.v-textfield-readonly (so without the space in between)