On Jan 7, 3:36 pm, fermierul <[email protected]> wrote: > Code: > > TextBox textBox = new TextBox(); > textBox.setText("some text"); > textBox.setStyleName("myStyle"); // my style adds background color and > border > textBox.setReadOnly(true); > > At this point, the text displayed in the textbox does not become > distinctive for read only fields (i.e. being a sort of grayed out). > Instead the font stays unmodified just as if the text boxt was > editable. > > I use: gwt2.0, Firefox 3.5.7, XP
I haven't checked bu I guess that in most browsers (with the notable exception of IE, of course), you'd have to have a CSS rule with a "myStyle:readonly" selector. Your rule (class-based) is more specific than the default rule (input:readonly) used by the browser so it overrides it. That's the "cascading" nature of CSS in action. GWT though automatically toggles a dependent style name when you setReadOnly(), so you'd rather write a myStyle-readonly CSS rule to style the "readonly state".
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
