[Seaside] Links list
rleon at insario.com
Wed Apr 12 19:02:00 UTC 2006
> -----Original Message-----
> From: seaside-bounces at lists.squeakfoundation.org
> [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf
> Of Jaroslav Cmunt
> Sent: Wednesday, April 12, 2006 11:46 AM
> To: seaside at lists.squeakfoundation.org
> Subject: [Seaside] Links list
> Hi all,
> I am learning seaside and I am stuck with this code:
> html table id: 'conceptslist'; with: [
> html tableRow class: 'header'; with: [
> html tableData with: [ html text: 'Title' ]].
> self blogModel concepts do: [ :ea |
> html tableRow with: [
> html tableData with: [
> html anchor
> onClick: (html ajax
> ('concept',ea id asString);
> callback: [ :r
> | self editConcept: ea on: r ]);
> with: ea title.
> html div id: ('concept',ea id asString) ]]]]
> No matter what I try, when I click any of the rendered links,
> editConcept:on: is called with last member of concepts collection.
> When I was using normal callback (not scriptaculous stuff),
> everything worked.
> Jaroslav Cmunt
I'm guessing you're assuming that
callback: [ :r | self editConcept: ea on: r ]
is a closure and should remember each, and I'm guessing that
callback: [ :r | self editConcept: ea on: r ] fixTemps
Will solve your problem. In this scenario, ea is actually a method level
variable. Blocks aren't yet full closures in squeak, YET.
More information about the Seaside