[Seaside] Generated links (anchor -> callback)

Mark Ross mark at markross.de
Sun Jul 5 20:14:37 UTC 2009


Hi seaside list!

I'm roughly new in developing seaside. Trying out some seaside development.

I'm using:
GemStone/S 64 Bit
2.3.1 Build: gss64_2_3_x_branch-20643
Thu Dec  4 11:33:32 2008

with GemTools 2.3.1

I would like create links on my page - with generated URLS, which have the
value of the index from render time.

I try by using something like this:

initialize
        super initialize.
        self value: 0

renderContentOn: canvas

canvas text: self value.

   1 to: 10 do: [ :index |
       canvas anchor
          callback:[ self value: index  ];
                 with: index.
       html space ].

-> The value is everytime clicking on a link '10' - which I would
understand, if i didn't read the tutorial on the seaside.st site:

-----snip -----
renderContentOn: html
   1 to: 10 do: [ :index |
       html anchor
          callback: [ index inspect ];
          with: index.
       html space ]

It will generate a series of links, labelled from 1 to 10. Because the
action blocks capture the current value of the i variable, each one will
have a distinct callback: clicking on the "1" link will evaluate 1
inspect, on the "2" link will evaluate 2 inspect, and so on. The block
closure is being used to maintain all of the interesting state for the
link.
-----snap-----

Please, can somebody help me out finding my mistake?

Best regards

Mark




More information about the seaside mailing list