File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IE8 and TextBox font color?

 
Joe Vahabzadeh
Ranch Hand
Posts: 140
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are setting the style name as customTextBoxStyle but your css uses disabledtextbox
 
Joe Vahabzadeh
Ranch Hand
Posts: 140
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you try with setStylePrimaryName instead?
 
Joe Vahabzadeh
Ranch Hand
Posts: 140
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic