[Seaside] S-Expr conditionals

Jim Benson jb@speed.net
Sat, 1 Jun 2002 18:33:31 -0700


> What you need is to bind to the bgcolor of that cell.  In 0.93, that
> means something like this:
> MyCalendarComponent>>addBindingsTo: template
>   (template elementNamed: 'aDay/week')
>     set: #bgcolor toPath: 'dayBackground'.
> Then you need to write the #dayBackground method to return the correct
> color.  This will need to know the value of 'aDay', which is a
> template-local variable, and so is stored in 'locals'.  So you want
> something like this:
> dayBackground
>   ^ (locals at: #aDay) = Date today
>       ifTrue: ['ff0000']
>       ifFalse: ['ffff99']
> That work?

Of course it works ;-) But you already knew that. It's funny, this is one of
those cases of  "Here's good documentation, here's the tutorial" which I go
through and think I understand. Still doesn't mean I know how to use it.