[Seaside] Problem loading css in updateRoot:

Philippe Marschall philippe.marschall at gmail.com
Wed May 28 12:15:16 UTC 2014


On Wed, May 28, 2014 at 12:01 PM, jtuchel at objektfabrik.de
<jtuchel at objektfabrik.de> wrote:
> Hi Phillipe,
>
> first of all: thanks for your time!
>
> Am 28.05.14 11:07, schrieb Philippe Marschall:
>
>> On Wed, May 28, 2014 at 9:01 AM, jtuchel at objektfabrik.de
>> <jtuchel at objektfabrik.de> wrote:
>>>
>>> Hi,
>>>
>>> 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.
>>
>> That's implemented in a specific component class of yours?
>
> Right. That's in the component which creates html tags with specific
> css-classes that are styled in the referenced buaDetailsCss
>
>
>>
>> The browser should not matter since it's either in the HTML or not.
>
> Yes, that's logical.
>
>
>>> 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...
>>
>> Are you using AJAX?
>
>
> Yes, the page that contains the component has a number of Ajax calls. Most
> of them are only issued on click, keyup/down or blur. I do not use ajax
> onLoad or such. So I see no connection here.
> In my mind, the same argument as above stands: ajax shouldn't be important
> here, the link is either in the <head> or not.
>
> But I guess you have something in mind when you ask that?

Yes I do. If the component is inserted into to the page using ajax it
does not (can not) update the <head>. If you then do a full page
reload and the component is no longer inserted using ajax but part of
the full page rendering it can update the <head>. Could this be what
is happening in your case?

Cheers
Philippe


More information about the seaside mailing list