tags:

views:

24

answers:

1

Hey all-

Here's what I've got. I have a tree in GWT set up to process only a certain level depth of children, retrieving from the server and only updating according to which children one clicks. I am familiar with addStyleName() functions and I have used this to style the foreground color of certain tree nodes, and it has appeared successfully on previous versions of my project (without the server calls).

The question boils down to if any of you familiar with GWT know any reason why my custom CSS would be overridden on a child update of a node. So for example, when the server processes a node, it shows up in my proper CSS color, but once the server shows that it has children, it does the addItem() to that node and the CSS of the text color of the parent is reverted back to default.

This is all under the assumption that I have no removeStyleName() calls or any deleting/recreating going on. Anyone familiar with a situation like this?

Thanks!

EDIT: Here's some code I've narrowed it down to

HTML

<html>
<head>
<link type="text/css" rel="stylesheet" href="test.css">
</head>
<body>
<p>blaghblagh</p>
<div class="Foreground1">
    hey
    <table style="white-space: nowrap;">
        <tbody>
        <td style="vertical-align: middle;">
            <div style="display: inline;">
                ContinuingPromise '08
            </div>
        </td>
    </tbody>

</table>

CSS:

body{
color: black;
}
.Foreground1{
color: green;
}

If you put this code up, you'll see the ContinuingPromise as black, although it is within the foreground div which should be green. Also, the word 'hey' will appear green. Am I missing something basic? Thanks again

+1  A: 

I'm not sure if this solved your original question, but the color problem is very likely caused by the doctype you're using. If the html page uses quirks mode, the style properties are not correctly inherited by the table. See http://reference.sitepoint.com/css/inheritance. Setting a doctype or different doctype might solve your problem. If you are using any of the GWT layout panels you need to set the doctype to <!DOCTYPE html>, see http://code.google.com/webtoolkit/doc/latest/DevGuideUiPanels.html#Standards

Hilbrand
Great, that will do it. I haven't ever really looked at the difference between quirks/standards mode but that all makes sense now that I actually ran into a problem with it haha. Although, since this is quite a large project that I am not too familiar with, I don't want to mess up any of the few panels that might still be buggy. I found a workaround to just add a * after each class that had this table within it, and it seemed to apply nicely. I will remember this in the future, thanks again.
Mojave Storm