[Seaside] Re: Modal dialogs that appear with their "background"
stephan at stack.nl
Tue Jun 10 21:06:53 UTC 2014
>One thing that I don't understand is why you have to create one class
>per anouncement, instead of using a general class for showing (Tonen)
>and modifying (the other :) ), passing the component class as
Good point. Mostly because we didn't get real feedback on it before ;)
It started as a smaller example, and we tried to be more explicit.
It has grown a bit, and we should refactor this.
Having a separate class for each announcement is easier to follow
for people new to smalltalk than doing meta programming voodoo
with parameters. We have also not shown you
DEPageChoice>>addPage: page announcement: announcement subject: subject accessors: accessors
self addPage: page.
do: [ :ann |
| temp |
temp := subject.
accessors do: [ :each | temp := temp perform: each ].
page subject: temp.
self currentPage: page.
>Another thing that I don't understand is why in your example you
>create all the pages beforehand, instead of creating them as they are
>needed to be shown.
If you are very careful about your design, you can do much more lazily.
We do use lazy creation, especially in the leave components.
Reacting to announcements in one subcomponent that come from another
subcomponent gets interesting when their parents have not been created
yet. We found already creating top level components often easier.
More information about the seaside