[Seaside] The rendering context XHTML document is nil on page refresh

Julian Fitzell jfitzell at gmail.com
Mon Aug 3 16:34:22 UTC 2009


Hi Damien,

I don't see an obvious problem, I'm afraid. As Karsten mentions, a
RequestContext has its variables nil'ed out when it is finished and
its response is returned, and that's the most likely cause of the
document being nil, but I certainly don't see anything in the code you
posted that would explain that. Usually that is caused by somebody
storing the canvas and using it again in another request (like, an
ajax rendering callback).

So make sure you're not storing the canvas or request context anywhere
and that any ajax callbacks are using the rendering that is passed to
the block, and not the one in the rendering method (Slime checks for
the latter). If neither of those is your problem, try stripping your
code down to the simplest example that demonstrates the problem and
someone will take a look at it.

Julian

On Mon, Aug 3, 2009 at 2:00 AM, Damien Cassou<damien.cassou at gmail.com> wrote:
> Hi Julian,
>
> On Mon, Aug 3, 2009 at 3:04 AM, Julian Fitzell<jfitzell at gmail.com> wrote:
>> Can you show GdoHeader>>renderContentOn: ?
>
> renderContentOn: html
>       html div
>                       id: 'bdGlobal';
>                       with:
>                               [ html div
>                                       id: 'bdTitre';
>                                       with: [ html heading with: titre ].
>                               self renderRecherche: html.
>                               self renderLogo: html ]
>
> renderLogo: html
>       html div
>               id: 'bdIdentLogoGlobal';
>               with:
>                       [ html div
>                               id: 'bdLogo';
>                               with:
>                                       [ html image
>                                               url: (GdoFileLibrary
> urlOf: #logoLP390x80Png);
>                                               altText: 'LaPoste' ]]
>
> renderRecherche: html
>       html div
>               id: 'bdRechGlobal';
>               with:
>                       [ html div
>                               id: 'bdNomRechGlobal';
>                               with: [ html render: self recherches ] ]
>
>
> recherches
>       chainesARechercher = '#none#' ifTrue: [^ nil].
>       ^ search ifNil:
>               [ search := GdoHeaderRecherches new
>                       chainesARechercher: chainesARechercher;
>                       gdoMain: gdoMain;
>                       yourself ]
>
> children
>       ^ {self recherches}
>
>> Can you define "sometimes"? Do you mean certain pages do it and
>> certain pages don't or, on any given page, sometimes it happens and
>> sometimes not?
>
> 1) The first page displays correctly the first time
> 2) If I hit refresh then I get the error message
> 3) If instead I go to another page, I never get the message again when
> clicking on refresh, even if I go back to the first page and hit
> refresh
>
> Does that help?
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Lambdas are relegated to relative obscurity until Java makes them
> popular by not having them." James Iry
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>


More information about the seaside mailing list