# Style sheet and Background Color Problem

**URL:** <https://forum.servoy.com/t/style-sheet-and-background-color-problem/8174>\
**Category:** Classic Servoy\
**Created:** [September 25, 2007, 12:31am UTC](https://forum.servoy.com/t/style-sheet-and-background-color-problem/8174 "2007-09-25T00:31:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Mooney](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Michael\_Mooney](https://forum.servoy.com/u/Michael_Mooney)\
**Post date:** [September 25, 2007, 12:31am UTC](https://forum.servoy.com/t/style-sheet-and-background-color-problem/8174/1 "2007-09-25T00:31:30Z")

</div>

Semi-related thread closed by author on [http://forum.servoy.com/viewtopic.php?t=9203](http://forum.servoy.com/viewtopic.php?t=9203). While a _somewhat_ related topic, a new Subject/Issue is introduced here not inferred by the original subject line in 9203.

ISSUE:  
Forms are not honoring programmatic background color settings when a style is active.

SCENARIO:  
Consider the following scenario:

1. Style sheet is setting the default color to Light-Blue-A (hex notation ignored for ease of reading this thread);

2. The style sheet sets a standard color for data entry fields. Let’s call this color Light-Blue-B. I am using standard Servoy CSS Style Sheet properties.

3. A Data Change event examines the condition of data in a field. If the data is incorrect the field color is set to Red. Otherwise it is set to the standard data entry field color of Light-Blue-B (i.e. - exactly the same color as the Style sheet color setting).

4. When this event fires, and the data passes validation successfully, the attempt to set the field to the standard data entry color (Light-Blue-B) fails. Instead, the default _Form_ color of Light-Blue-A is used.

If I am not using the same color in the Data Change event code the problem does not occur. In other words, in scenario condition “3.” the true condition for data validation would be say “Light\_Magenta” instead of “Light-Blue-B”: this will run fine.

Problem confirmed (100% replicable) with different hex color settings. I thought maybe I had the wrong blue chosen somewhere which is why I tried different color combo’s. The field display type’s I have tried are TEXT\_FIELD and TYPE\_AHEAD.

Is this a bug or am I doing something wrong? ver 3.5.1. I have double and triple-checked my code and the style sheet definition (looking for color override conditions). Forum feedback pls prior to issuing a bug filing.

A ps/edit after posting: this started to work again (properly). Nothing changed in the code/CSS. Any known issues (Java or ?) impacting color rendering??? The problem is 100% replicable when it goes into this “condition”. ![:(]( "Sad")

Thanks, Michael

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [September 25, 2007, 7:56am UTC](https://forum.servoy.com/t/style-sheet-and-background-color-problem/8174/2 "2007-09-25T07:56:48Z")

</div>

Strange that it sometimes works, and sometimes does not work.  
I will try to see if I can trigger this bad behavior.

So we still have no idea about the “condition” that triggers it… Maybe it is only immediately after writing the solution - or something like this…

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [September 25, 2007, 9:04am UTC](https://forum.servoy.com/t/style-sheet-and-background-color-problem/8174/3 "2007-09-25T09:04:50Z")

</div>

It figures… I cannot reproduce this either.

---

<div class="post-metadata">

**Author:** ![Michael\_Mooney](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@Michael\_Mooney](https://forum.servoy.com/u/Michael_Mooney)\
**Post date:** [September 25, 2007, 3:24pm UTC](https://forum.servoy.com/t/style-sheet-and-background-color-problem/8174/4 "2007-09-25T15:24:32Z")

</div>

It’s a Murphy Law Bug - like when my car acts up and behaves perfectly at the mechanical garage. Maybe add this classification to the Bugzilla db ![:wink:]( "Wink")

I’ll let you know if I can get a stable replicable condition.

Michael
