[Seaside] repeats on home-made components

Tim Rowledge seaside@lists.squeakfoundation.org
Thu, 18 Jul 2002 11:45:03 -0700


Avi Bryant <avi@beta4.com> is claimed by the authorities to have written:


> Well, you need to separate the loop out from your component, so you
> probably want something like
> 
> <div sea:id="question/questions">
>   <page sea:id="pane"></page>
> </div>
> 
> (or if you don't like having the <div>s that will create, use the <repeat>
> tag which won't show up as anything).
OK, that I can grok.
> 
> Then you want something like
> 
> (template elementNamed: 'pane')
>   class...;
>   set: #theQuestion toPath: 'question'
That is fine except...
> 
> The path there is referencing the local "question" variable created for
> that repeat.
...I don't see how they inter-relate.

I guess I'll just accept the magic for now and worry about it another
day. I imagine it implies that the templates are checked each time a
component is added, whereas I was seeing it a bit more static. That's
what happens when you spend years doingVM stuff, you get so used to the
limitations imposed by C that it's hard to accept how flexible the
_real_ stuff is.

It does remind of another strangeness with #addBindingsTo: though.
Various things had made me think you were running the method in any
class you found it up the chain from the origin class of a component.
That seemed odd, but I've seen it done before and so didn't get too
excited. However, I recently refactored a load of stuff and it seems
more like you're doing nothing unusual at all, so to make use of
bindings set up in an abstract superclass one needs to do the normal
super send. Which hallucination is the correct one?

tim
-- 
Tim Rowledge, tim@sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Bad style destroys an otherwise superb program.