[Seaside] Iterators in 0.94

Jim Benson seaside@lists.squeakfoundation.org
Wed, 26 Jun 2002 10:34:41 -0700


This is a multi-part message in MIME format.

------=_NextPart_000_00D1_01C21CFD.14743960
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Back in the good old 0.93 days, I had a sketch for a little calendar app. I
include it here for old times sake.

OK, I go to convert it into 0.94.

The way the calendar is supposed to work is that each day on the calendar
has a color attached to it. You basically draw the days with the code in the
RVCalendar>>html template with in 0.93 :

  ( tr repeat: '@week/weeks'
  ( td repeat: '@aDay/week'
    ( div align: center (font size: '+1' ( a sea:id: dayJump
'[aDay.dayOfMonth]' )))
  )
 )

assign the color of the day with the binding:

addBindingsTo: template

  (template elementNamed: 'aDay/week')
    set: #bgcolor toPath: 'dayBackground'.


where RVCalendar>>dayBackground figures out which day it is by

subjectDay := locals at: #aDay


Fair enough.

I start my 0.94 conversion. I know that I have to create an addHandler
method for the IARepeatIterator. I thought it would be something along the
lines of:


 (template elementNamed: '@aDay/week')
  onDisplay: [:r |
   r list: #week; iterator: #aDay;
   attributeAt: #bgcolor put: self dayBackground].

but when I get into >>dayBackground, there is nothing in the locals to
indicate that there is anything associated with #aDay.


Also, I a DNU barks at me when it gets to the

aDay.dayOfMonth

line, saying that it 'Could not find value for key "dayOfMonth"'.

What am I missing? I assume that I'm messed up in the addHandler method.

Jim




------=_NextPart_000_00D1_01C21CFD.14743960
Content-Type: application/x-gzip;
	name="RVCalendar.st.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="RVCalendar.st.gz"

H4sIAAAAAAAAAKVWbU/jRhD+7A/+DwMndRNVhNiBEHw6qb2jSEW9Ul3Q8YHj0Ma7dhbsXXe9gabi
x3dm7byiFImzFGdfZmeemXlm1uzcmhLGf88kfxj04pyXJQeTQXQMF1zPuJ1D3O/HcFNwJ2sHs0rg
IIF3R6NRdAtGQzyEi5mWjRh3EPWTaJgMjoGXbC/8/ddPpqyMltpBPZukBa9rPP3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