Hello,

about to deploy to production an evolution of a project, customer
calls and says "hidding icons fails in Firefox". What?

Firebug to the rescue says the icons have a nice "display: none" after
I call setVisible(false).

Changing by hand to display: none !important works and I accept it as
a solution (did I say that I start holidays on friday evening and
kitesurfing sounds a better idea than coding in a cybercafe?)

I tried a custom setVisibilitat method that does setVisible and
getElement().getStyle().setProperty("display","none !important") if
needed, but this fails, see generated JavaScript for details:

function $setVisibilitat(this$static, visible){
var style;
// This is setVisible(false);
this$static.element.style.display = visible?'':'none';
if (!visible) {
// This is Style style=getElement().getStyle();
style.setProperty("display","none !important");
style = this$static.element.style;
style['display'] = 'none !important';
}
}

The if ( !visible) above executes but fails and leaves display:none. I
wonder whether the reason is this difference
        this$static.element.style.display =
versus
        style = this$static.element.style;
        style['display'] =
Notice the dot property against the array property.

Sorry, what? Did I hear someone talking about setDisplay(Display d)?
Well, according to this the enum does not cover the !important thing:
http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/com/google/gwt/dom/client/Style.Display.html

So far, a good solution will be managing some way of programatically
setting the !important bit, but my Google mojo wasn't able to find it.
Ideas are welcome.

In the end, I think I could have defined some sytle that has the
display: none !important, but don't like adding that many styles and
(don't tell anybody) I programatically got the style, looked for
display: none and added in place !important, keeping all other style
properties. Works. Holidays. Kitesurf :)

-- 
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.

Reply via email to