[Seaside] WAAsyncHtmlRenderer and CSS
michel.bany at gmail.com
Thu Apr 5 19:59:40 UTC 2007
On 10 Apr 2007, at 12:25 , Sebastian Heidbrink wrote:
> I'm using Squeak 3.9 and Seaside 2.7.
> On my site I have a mainframe including header, menues and a
> subframe with content.
> The mainframe has WARenderCanvas as rendererClass.
> One of my subframes needs to be updated several times. Therefore I
> decided to use the SeasideAsync package and set the rendererClass
> to WAAsyncHtmlRenderer.
Try using WAAsyncRenderCanvas rather than WAAsyncHtmlRenderer. The
former is for the canvas api, the later is for the older api.
Since you are using the canvas api for your main frame, you should
also use the canvas api for your async components.
> Two problems appear.
> First, the content of the AsyncSubframe is only shown when its
> registered as application and shown as a single site without my
> mainframe. Embedded in the mainframe it doesn't appear.
It should work, did you add the Async library (WAAsyncScripts) to the
Alternatively you can also use WAAsyncComponent as the superclass for
your mainframe component.
> Second, everytime the AsyncSubframe ist rerendered, I want to
> change the cssStyleSheet. Therefore my asyncDiv looks like that:
> "renderContentOn: html
> html divNamed: 'XY' with:[:event: h | self updateSomething.
> h style: self
> renderTheNewContentOn: h] every: 5 seconds."
With the WAAsyncRenderCanvas this would become something like this
refreshWith: [:event :h | ... ] every: 5 seconds.
> I tested the updatedCssStyleSheet-thing with a non-async-
> rendererClass and the contents was shown in the Css-Viewer of the
> webframework and the site works fine. But using it async it isn't.
> It works but position information isn't recognized properly.
> Inside of updatedCssStyleSheet there are 'position: absolute'-Css-
> desciptions and the needed 'position: relative'-Css-desciptions is
> declared in an 'XY'-enclosing div-tag but the position information
> is ignored. As I said, it works static, but periodic it doesn't.
> Is there any other posibillity to change the style periodic?
<style> elements that you include in a live callback.
You should rather play with css class instead and add the
corresponding selectors to your main style sheet.
refreshWith: [:event :h | ...
h div class: 'periodic'; with: [self renderTheNewContentOn: h] ]
every: 5 seconds.
elements that you include in the live callbacks.
> And one more question.
> Porting a site from not-async to async is a little circumstantial.
> Why is there a different naming for things meaning merely the same?
> div id: ; with: and divNamed: with:, for example.
If you use WAAsyncRenderCanvas rather than WAAsyncHtmlRenderer things
will look consistent.
> Ah. And one more thing. I couldn't load Seaside 2.8a with
> SeasideAsync. Will there be any changes in future?
SeasideAsync supports Seaside 2.6 and 2.7 and has not yet been
updated for 2.8.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Seaside