[Seaside] with: takes block vs string

SainTiss saintiss at gmx.net
Wed Jul 23 13:31:12 UTC 2008


Ok, I see...

The point is that I don't really want to pass a block to javascript, as, 
indeed, that wouldn't make sense: I just want to embed some *html string* in 
javascript, like this:

<script>
myHtmlString='<a href="internalSeasideLink">test</a>'
</script>

So the whole point is that I want to use "html anchor" to generate the correct 
html string for me, since there seems to be no other way to figure out 
the "internalSeasideLink" in my example, which I need if I want the link to 
execute a callback

Hans

On Wednesday 23 July 2008 14:23:58 Gerhard Obermann wrote:
> Sorry i am reading too fast.
> script: is an exception because javascript is only evaluated on the client.
> Obviously you cant pass a block to javascript.
>
> Just look at WAScriptTag!
>
> > self document nextPutAll: aString displayString
>
> It only takes the displayString of the argument.
>
> br
> Gerhard
>
> On Wed, Jul 23, 2008 at 2:00 PM, SainTiss <saintiss at gmx.net> wrote:
> > In that case, how come:
> >
> > html script with: [html text: 'testing']
> >
> > renders:
> >
> > <script type="text/javascript">/*<![CDATA[*/[] in
> > STAAMenuComponent>>renderContentOn: {[html text:
> > 'testing']}/*]]>*/</script>
> >
> > while html script with: 'testing'
> >
> > renders:
> >
> > <script type="text/javascript">/*<![CDATA[*/testing/*]]>*/</script>
> >
> > ?
> > This is what I mean by the script tag expecting a string. Sure, you can
> > pass
> > it a block, but the block won't be evaluated as I would like it to be.
> >
> > Or did I misunderstand you?
> >
> > Thanks,
> >
> > Hans
> >
> > On Wednesday 23 July 2008 13:53:00 Gerhard Obermann wrote:
> > > That is not correct.
> > >
> > > Look at the implemenation in WATagBrush.
> > > with: 'asdasd' and with: [] and: with: anyKindOfObject
> > > is basically available for all tags!
> > >
> > > The argument of #with: is rendered using
> > > double dispatching, therefore any object can be
> > > passed as argument.
> > >
> > > br
> > > Gerhard
> >
> > --
> > A liberal is a person whose interests aren't at stake at the moment
> >  -- Willis Player
> >
> > Hans Schippers
> > Research Assistant of the Research Foundation - Flanders (FWO -
> > Vlaanderen) http://www.win.ua.ac.be/~hschipp/
> > <http://www.win.ua.ac.be/%7Ehschipp/> Formal Techniques in Software
> > Engineering (FoTS)
> > University of Antwerp
> > Middelheimlaan 1
> > 2020 Antwerpen - Belgium
> > Phone: +32 3 265 37 88
> > Fax: +32 3 265 37 77
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



-- 
A liberal is a person whose interests aren't at stake at the moment
  -- Willis Player

Hans Schippers
Research Assistant of the Research Foundation - Flanders (FWO - Vlaanderen)
http://www.win.ua.ac.be/~hschipp/
Formal Techniques in Software Engineering (FoTS)
University of Antwerp
Middelheimlaan 1
2020 Antwerpen - Belgium
Phone: +32 3 265 37 88
Fax: +32 3 265 37 77


More information about the seaside mailing list