[Seaside] Problem with callback blocks sharing context using
leves at elte.hu
Mon Nov 1 01:52:51 UTC 2010
On Mon, 1 Nov 2010, Hernán Morales Durand wrote:
> Hi all,
> I'm experimenting different behavior between Seaside 2.8 and 3.0
> regarding parameters passed in callback blocks. Attached there is code
> to test in both platforms (just click in any of the first 8 links),
> the problem is in the variable index in the #callback: of the
> following code
> | index |
> index := 1.
> 8 timesRepeat: [
> aRenderer tableRow: [
> 5 timesRepeat: [
> aRenderer tableData: [
> aRenderer anchor
> callback: [ self callbackFor: index ];
> with: 'image link'.
> index := index + 1.
> ] ] ] ].
> In Seaside 2.8 after clicking the link 3 for example, the
> #callbackFor: method received 3 as parameter.
> In Seaside 3.0 #callbackFor: receive 41.
> I would like to preserve the parameter value configured in the
> rendering phase, any suggestion how to do that in Seaside 3? (Using
> PharoVM 4.0.2 12/4/2010 and Pharo1.1rc2 #11400)
Use an image with support for closures. Or if that's not possible, then
send #fixTemps to the callback block.
> Hernán Morales
> Information Technology Manager,
> Institute of Veterinary Genetics.
> National Scientific and Technical Research Council (CONICET).
> La Plata (1900), Buenos Aires, Argentina.
> Telephone: +54 (0221) 421-1799.
> Internal: 422
> Fax: 425-7980 or 421-1799.
More information about the seaside