Problems using Selector objects

1 view
Skip to first unread message

PEZ

unread,
Apr 14, 2010, 5:45:11 AM4/14/10
to GWT-FX
Anyone got the Selector morphs to work? For me it only works in
Firefox. Looking at the HTML produced I see no difference in adding
the stylesheet to the .gwt.xml or the HTML file. Neither is there a
difference in how it doesn't work.

Adam T

unread,
May 9, 2010, 2:03:24 AM5/9/10
to GWT-FX

Adam T

unread,
May 9, 2010, 2:09:16 AM5/9/10
to GWT-FX
[Mmmm, to quick on hitting submit button with last message!]

Hi PEZ,

Do you have an example of what you are trying to do, the styling and
the code, any error message you get?

If you look at the logo on the example page, that only uses selectors
and works at least for me in all browsers I've tried (http://
gwtfx.adamtacy.com/EffectsExample.html#intro).

By including the style link in the .gwt.xml file, GWT ensures the
stylesheet is loaded before the application runs (of course, if you
have the style inline in the HTML you have achieved the same). If you
try and load an external style sheet from the HTML it might be the
case that your GWT application starts before the style is available
hence any effect based on that style will not work.

Best Regards,

Adam

DaveC

unread,
Jul 6, 2010, 5:15:06 AM7/6/10
to GWT-FX
Hi There,

I ran into this problem... using CSSResource and ClientBundle - GWT
waits for an oportunity to inject the CSS, the effect was that the
Selector was looking for something that wasn't there.

(from gwt
* docs)...
*
* * * * * * * * * * * * * * * * * * * * *
*
* DOM manipulation, especially manipulating style elements, has a
* measurable cost. In the interest of improving runtime
performance,
* StyleInjector does not manipulate the DOM immediately. Each
call to
* CssResource.ensureInjected() or StyleInjector.inject() will
append the
* contents to be injected into a buffer and use
Scheduler.scheduleFinally()
* to perform the DOM manipulation immediately before control
returns to the
* browser's event loop. This optimization makes the
* inject-in-static-initializer pattern operate without excessive
runtime
* cost.
*
* If it is necessary to have StyleInjector mutate the DOM
immediately,
* there are overloads of the inject() method which accept a
boolean
* parameter indicating that the DOM should be updated
immediately.
*
* * * * * * * * * * * * * * * * * * * * *

The fix was to use StyleInjector.inject(cssString, true)

Hope this helps.

Cheers,
Dave
> > > difference in how it doesn't work.- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages