[Seaside] Newbie questions

Pablo Iaria seaside@lists.squeakfoundation.org
Tue, 13 Aug 2002 18:13:40 -0300


Thanks a lot for answering !

Unfortunately it didn't works as expected....

I have a html file with:
<html>
    <body>
        <mytestcomponent sea:id="testing"></mytestcomponent>
    </body>
</html>

I set the "Document Root" property with the file path and I added the
"template" method you told me earlier but I got the "MessageNotUnderstood:
children"  message.

Am I doing something wrong ? or this feature is not working any more ?

Thanks,
    Pablo.-


----- Original Message -----
From: "Julian Fitzell" <julian@beta4.com>
To: <seaside@lists.squeakfoundation.org>
Sent: Tuesday, August 13, 2002 4:45 PM
Subject: Re: [Seaside] Newbie questions


> Alain Fischer wrote:
> > Hi Pablo,
> >
> > I have not used Seaside for a while, the following tips could have
changed
> > with recent version of Seaside.
>
> Indeed they have a little.  You must not have seen my reply yet but I'll
> comment a little more here on the differences for those who care.
>
> >> 1)   If I have:
> >>         Test>html
> >>             ^'<img src="image.gif">'
> >>
> >>       where should I put the file "image.gif" to get it displayed on
the
> >> browser ?
> >
> >
> > - You must have a static content server (Comanche is able to do this)
> > - You must configure the "Document Root" of your application in Seaside
> >    to point to your static content server.
>
> This is a little outdated.  In Seaside 0.93 we used a URL as the
> document root and if you made an img tag dynamic (@src="..." instead of
> src="...") then it would prepend the URL of the document root to the
> image name.  As of 0.94, though, image tags do not need to be dynamic,
> they work be noticing the "resource/" portion of the URL and looking up
> the Document Root which is now a filesystem path.  Note that this trick
> also work with <a href="resource/foo">Link to foo</a>
>
>
> >> 2) I have a jsp/asp background (and a little of zope) and I found that
is
> >> much easier to write html code outside Squeak. Is there a way to use
file
> >> based templates ? (I saw the class IAFileTemplate but I couldn't
> >> figure out
> >> how to use it).
> >
> >
> > In your component define the following method:
> >
> > template
> >     ^ IAFileTemplate new
> >         file: 'toto.html';
> >         bindWith: [:t | self addBindingsTo: t]
>
> Again, this code works in 0.93 but is slightly different with 0.94.x
>
> #bindWith: is no longer used and a call to #addHandlers is used instead
> of #addBindingsTo:.  Also, the template is stored in an instvar and
> should be created only when the instvar is nil.  The instvar gets set to
> nil whenever the template needs to be flushed (with a file template,
> basically only if you change the #addHandlers method).  IAFileTemplate
> itself implements a check to see whether the file on disk has changed
> since it was last loaded and reloads it if necessary.
>
>
> Julian
> --
> julian@beta4.com
> Beta4 Productions (http://www.beta4.com)
>
> _______________________________________________
> Seaside mailing list
> Seaside@lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside