css for SuperImmediateTextField

Hi,
How can I set the default
TextField css style
to the
SuperImmediateTextField
?
thanks

Henrik really should’ve used the default textfield stylename when he created this component, it’s just redundant that a textfield would look different even if it is “super immediate”. I suggest you go and bug him about this issue on this thread:
SuperImmediateTextField forum thread

Anyway, just add a stylename “v-textfield” to the superimmediate textfield, and you’re halfway there (focus style will be missing, I bet).

SuperImmediateTextField.addStyleName("v-textfield");

Thank you Jouni for reply, I added the “v-textfield” style name and the “v-textfield-focus” style name:

SuperImmediateTextField.addStyleName("v-textfield");
 SuperImmediateTextField.addStyleName("v-textfield-focus");

but can I get the textfield style name using this method?:

SuperImmediateTextField.setStyleName(new TextField().getStyleName());

No need to add the focus style, that’ll just make the field look like it’s always focused, even when the user is typing into another field. That’s not what you want, ever. Bad usability.

No, you can’t, that would just return the additional stylenames that
you
have defined to the field. And for a new instance of TextField, that will return null or an empty string. But you can use the following:

VTextField.CLASSNAME

Thanks, it work’s.