[Seaside] repeated page weird problem (or bug?)

Avi Bryant seaside@lists.squeakfoundation.org
Thu, 3 Oct 2002 10:48:53 -0700 (PDT)


Copying this back to the list...

On Thu, 3 Oct 2002, Ragnar Hojland Espinosa wrote:

> On Wed, Oct 02, 2002 at 12:02:52PM -0700, Avi Bryant wrote:
> >
> > On Wed, 2 Oct 2002, Ragnar Hojland Espinosa wrote:
> >
> > > Take your time..  I'm fighting with img srcs right now :)
> >
> > What problems are you having with them?
>
> I want the image tag below hold what the string returned by a method (say
> getIconName) returns.  But no matter what I do I can't get it working... I
> manage to get duplicate img src tags inside the img src, or add a value tag,
> or .. but not the simple case.

I was just doing something similar, and what I got to work was

html
  ^ '<img sea:id="foo">'

addHandlers
  (template elementNamed: 'foo')
    class: IAElement; "crucial step"
    onDisplay: [:i | i attributeAt: 'src' put: ...]

The trick is that you have to tell Seaside to treat 'foo' as a generic tag
and not as an IAImage, so that it doesn't intefere with what you put in
'src'.

>
> ExListDocLine>>getIconName
> ^ 'http://localhost/logo.png'
>
>
> ExListDocLine>>html
> ^ #(html
>   	(td (a sea:id: viewPreviewDoc (img src: ???)) )
> 	(td (a sea:id: viewDoc '[parent.doc.shortdescr]') )
>   )
>
> Damn eye candy ;)
> --
> Ragnar Hojland - Project Manager
> Linalco "Especialistas Linux y en Software Libre"
> Tel: +34-91-5970074 Fax: +34-91-5970083
>