[Seaside] Problem loading css in updateRoot:

jtuchel at objektfabrik.de jtuchel at objektfabrik.de
Wed May 28 07:01:50 UTC 2014


I tried adding a css file from a WAFileLibrary sublass to only one 
component, because it is really just needed on pages that use the 
WAComponent that refernences it. The reason is that if you use 
#selectorsToInclude on the file library, the css will be imported into 
every single page. It is a larger css file, and since our production 
server uses https, I'd like to avoid importing too much.

So I implemented this:

updateRoot: htmlRoot

    super updateRoot: htmlRoot.
    htmlRoot stylesheet beCss url: KontolinoFileLibrary / #buaDetailsCss.

I either don't understand the purpose of updateRoot: completely or there 
is some problem with this approach:

In IE 11 and Safari 7.0.4 as well as Firefox 29, the css link is not 
always in the head-section of the resulting page. But is there if I hit 
the Browser's reload button on the page. This is quite consistently so, 
but in maybe 3 out of 25 tries the css is also in the page when I 
navigate to it by call: or show:

So far I only tried that locally with direct http access to the image 
(development machine), no front-end http server.

Am I trying to do something at the wrong place - should I use another 
method for this?
Is this a bug in Seaside? I have only tried in VA Smalltalk so far...

For now, the css is back to #selectorsToInclude.

But I would like to use a technique that allows me to only add js and 
css files and such on pages that include a certain Component, to reduce 
load and execution times of complex pages.


Objektfabrik Joachim Tuchel          mailto:jtuchel at objektfabrik.de
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20140528/1ed68525/attachment.htm

More information about the seaside mailing list