[Seaside] option/selected and s-exprs?

Avi Bryant seaside@lists.squeakfoundation.org
Tue, 30 Jul 2002 11:45:33 -0700 (PDT)


On Tue, 30 Jul 2002, Ragnar Hojland Espinosa wrote:

> Nowwww.. could you explain what does (locals at: #c) and why do you need to
> do the option defaultDisplayEvent so we clueless people don't have to play
> monkey? :)

Certainly ;-)

When you set up an iteration through, eg, (select name: '@c/companies'
...), the current value of 'c' is stored in the locals stack (an instance
variable of IAComponent of type IAVarStack).  (locals at: #c) is just a
way of getting the current value of 'c'.  "locals last" would also have
worked (that gets the value of the most deeply nested iteration, rather
than looking for a particular variable by name).

As for defaultDisplayEvent - all elements have default display (and
update) events that generally sync their data based on the sea:id they
were given.  When you add an onDisplay: handler, you override this.
Sometimes, you want to override it; other times, you want to do something
that is orthogonal to what the default display events do (like setting an
attribute) in which case you want to make sure the default happens as
well.

That help any?