Hi fellow seasider's,
My first production application developed in seaside is almost ready, but even now i'm still fighting about how to correctly embed components in each other. For instance in the following scheme: Presenter A | ----- Presenter B (Header) | ----- Presenter C (Main application content) | | | ------ Presenter D (rendered inside Presenter C render routine) | ----- Presenter E (Footer) How can i go about having Presenter C or even Presenter A react to events in Presenter D? i've been trying to use #onAnswer: but i must admit all has been in vain so far. Another question i have is about differences between #children and #states methods in WAComponent. I've read on some post that #states behaves like the old #registerObjectForBacktracking but since i have never used this one either i'm having quite a hard time figuring this out. Thanks in advance for all your help. Alex Paes _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
2007/11/28, Alexandre Paes <[hidden email]>:
> Hi fellow seasider's, > > My first production application developed in seaside is almost ready, > but even now i'm still fighting about how to correctly embed components > in each other. For instance in the following scheme: > > Presenter A > | > ----- Presenter B (Header) > | > ----- Presenter C (Main application content) > | | > | ------ Presenter D (rendered inside Presenter C > render routine) > | > ----- Presenter E (Footer) > > > How can i go about having Presenter C or even Presenter A react to > events in Presenter D? i've been trying to use #onAnswer: but i must > admit all has been in vain so far. http://onsmalltalk.com/programming/smalltalk/maintaining-loose-coupling-in-seaside-components/ Just remember to unsubscribe your components once you don't need them anymore. Yes, this is kinda like manual memory managemnt. It would be much easier if we had reliable weak references. An other option would be to scope announcers to components and not the session. > Another question i have is about differences between #children and > #states methods in WAComponent. I've read on some post that #states > behaves like the old #registerObjectForBacktracking but since i have > never used this one either i'm having quite a hard time figuring this > out. #children returns all the direct child components of a component. That is every component you directly #render:. #states returns the state to be backtracked by Seaisde if the user uses the back button. If the contents of #children can change over time then you need #states to make the back button work. The easiest way is to return a collection (mostly Array) with only self. If you have your children in a collection you can simply return this collection. Cheers Philippe _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Hi Philippe,
Thanks for the help, i'll look into the Announcements framework, sounds really interesting and exactly what i need. Thanks for the explanation on #children vs #states matter, now it's time to digest and master that. Cheers, Alex Paes In 11/28/07 05:57 Philippe Marschall wrote: > 2007/11/28, Alexandre Paes <[hidden email]>: >> Hi fellow seasider's, >> >> My first production application developed in seaside is almost ready, >> but even now i'm still fighting about how to correctly embed components >> in each other. For instance in the following scheme: >> >> Presenter A >> | >> ----- Presenter B (Header) >> | >> ----- Presenter C (Main application content) >> | | >> | ------ Presenter D (rendered inside Presenter C >> render routine) >> | >> ----- Presenter E (Footer) >> >> >> How can i go about having Presenter C or even Presenter A react to >> events in Presenter D? i've been trying to use #onAnswer: but i must >> admit all has been in vain so far. > > http://onsmalltalk.com/programming/smalltalk/maintaining-loose-coupling-in-seaside-components/ > Just remember to unsubscribe your components once you don't need them > anymore. Yes, this is kinda like manual memory managemnt. It would be > much easier if we had reliable weak references. An other option would > be to scope announcers to components and not the session. > >> Another question i have is about differences between #children and >> #states methods in WAComponent. I've read on some post that #states >> behaves like the old #registerObjectForBacktracking but since i have >> never used this one either i'm having quite a hard time figuring this >> out. > > #children returns all the direct child components of a component. That > is every component you directly #render:. > > #states returns the state to be backtracked by Seaisde if the user > uses the back button. If the contents of #children can change over > time then you need #states to make the back button work. The easiest > way is to return a collection (mostly Array) with only self. If you > have your children in a collection you can simply return this > collection. > > Cheers > Philippe > _______________________________________________ > seaside mailing list > [hidden email] > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside > seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |