[Seaside] Re: Modal dialogs that appear with their "background"

Stephan Eggermont stephan at stack.nl
Tue Jun 10 21:06:53 UTC 2014


EstebanAM wrote:
>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 
>parameter. 

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.
	self announcer
		subscribe: announcement
		do: [ :ann |
			| temp |
			temp := subject.
			accessors do: [ :each | temp := temp perform: each ].
			page subject: temp.
			self currentPage: page.
		]
		for: self

>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. 

Stephan


More information about the seaside mailing list