GeeCON Prague 2014*
The moose likes GWT and the fly likes IE8 and TextBox font color? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » GWT
Bookmark "IE8 and TextBox font color?" Watch "IE8 and TextBox font color?" New topic
Author

IE8 and TextBox font color?

Joe Vahabzadeh
Ranch Hand

Joined: Jan 05, 2005
Posts: 140
All,

I have a situation where I'm trying to change the background and text color of a GWT TextBox (GWT 2.4).

In Firefox 5, this works just fine. In IE8, it takes the background color setting of the CSS but not the foreground color.

So, my code looks like so:


The CSS portion is as follows:



Is there some sort of workaround for this? I want the "color" attribute to apply to myTextBox consistently across browsers.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10426
    
    8

You are setting the style name as customTextBoxStyle but your css uses disabledtextbox


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Joe Vahabzadeh
Ranch Hand

Joined: Jan 05, 2005
Posts: 140
Ah, my apologies - I had an older version of the code and an older version of the CSS file where the style naming (among other things) was different. I copied the CSS from the older (wrong) version of the CSS file.

This is what it CURRENTLY looks like.

The code:


The CSS:


And with things as shown in the code snippets above, the behavior is as I've described in the original post.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10426
    
    8

Can you try with setStylePrimaryName instead?
Joe Vahabzadeh
Ranch Hand

Joined: Jan 05, 2005
Posts: 140
No difference in behavior.

Also, I should mention that:
1) There may be more things I have to do in that customTextBoxStyle in the future than I'm doing now. Already I know that I will probably be changing it to:


and it may change even further in the future

2) I will have to switch between having this style for the TextBox in question, and removing it, programmatically, based on user actions. I'm given to understand that removeStyleName(String) is not recommended and can have unintended side effects when doing so on a primary style name. To confirm, I temporarily added the new items to the style definition when trying setPrimaryStyle name... the border color setting only partially worked, if that makes sense.

But I digress - basically based on user action, I'll have to do addStyleName and removeStyleName for this style.

And I realize I'm somewhat rambling on a digressing topic because, ultimately, even using setPrimaryStyleName did not change the font color to black for the TextBox in IE8.
 
GeeCON Prague 2014
 
subject: IE8 and TextBox font color?