[Seaside] a sidebar which displays another component ?

Philippe Marschall philippe.marschall at gmail.com
Sat Apr 28 11:55:00 UTC 2007


Yepp:
http://www.lukas-renggli.ch/blog/decoupling?command=PRViewCommand&view=PBPostHtmlView

2007/4/28, Nicolas Petton <petton.nicolas at gmail.com>:
> On Sat, Apr 28, 2007 at 07:24:59AM +0200, Philippe Marschall wrote:
> > 2007/4/26, Nicolas Petton <petton.nicolas at gmail.com>:
> > >On Thu, Apr 26, 2007 at 10:11:37AM +0100, John Thornborrow wrote:
> > >> Nicolas Petton wrote:
> > >> > Hi,
> > >> >
> > >> > I'm using Seaside to make a web application, with some components :
> > >> > - the main application,
> > >> > - a sidebar,
> > >> > - the 'contents' component.
> > >> >
> > >> > The main application displays the sidebar and the contents.
> > >> > Can the sidebar have methods to change the contents ? I don't know how
> > >> > to do this because they are both subcomponents of the main application.
> > >> >
> > >> > Thanks,
> > >> >
> > >> > Nicolas Petton
> > >> >
> > >> >
> > >------------------------------------------------------------------------
> > >> >
> > >> > _______________________________________________
> > >> > Seaside mailing list
> > >> > Seaside at lists.squeakfoundation.org
> > >> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> > >> >
> > >> I've got exactly the same setup for one of my sites, we have a main menu
> > >> and a submenu. In order to cater for this, I have a registry which I use
> > >> for storing the main content component (amongst other things) and this
> > >> is passed to all components, then I have:
> > >>
> > >> renderContentOn: html
> > >>     html anchor class: 'menu'; with: [
> > >>        html text: 'Click this link']; callback: [
> > >>           self regsitry at: 'content' put: SomeClass new]
> > >>
> > >> My root component then uses:
> > >>
> > >> renderContentOn: html
> > >>     html render: self menu.
> > >>     html render: self submenu.
> > >>     html render: self content
> > >>
> > >> and of course the #content method:
> > >>
> > >> content
> > >>     ^(self registry at: 'content' ifNil: [DefaultContent new])
> > >>
> > >> HTH,
> > >> John
> > >>
> > >> www.pinesoft.co.uk
> > >
> > >Thank you for your answers !
> > >
> > >I think about another solution, maybe easier.
> > >In the main component, in the initialize method :
> > >
> > >sidebar := (Sidebar new) rootComponent: self.
> > >
> > >In the Sidebar class, I've got a rootComponent method :
> > >
> > >rootComponent: aComponent
> > >    rootComponent := aComponent
> > >
> > >So the sidebar knows its parent.
> > >Is it ugly code ?
> >
> > Yes, announcements are a better solution:
> > http://lists.squeakfoundation.org/pipermail/seaside/2007-April/011734.html
>
> I saw the announcement framework was in VisualWorks. Can I use it in
> Squeak too ?
> >
> > Cheers
> > Philippe
> >
> > >Nicolas Petton
> > >--
> > >                                ___
> > >.:! DEBIAN GNU/Linux !:.       / _ \
> > >                              | /   |
> > >    The universal OS          | \__/
> > >                               \
> > >-------------------------------------
> > >Ma clé GPG est disponible ici :
> > >http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE788C34D
> > >
> > >-----BEGIN PGP SIGNATURE-----
> > >Version: GnuPG v1.4.6 (GNU/Linux)
> > >
> > >iD8DBQFGMPfqgxoTqOeIw00RAmpfAKDFBkKMd4hse0F1nTXP+iFY+5Nm4gCgrh+U
> > >d3vIXQnAzRnOqs3ViRst4RA=
> > >=mVNx
> > >-----END PGP SIGNATURE-----
> > >
> > >_______________________________________________
> > >Seaside mailing list
> > >Seaside at lists.squeakfoundation.org
> > >http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> > >
> > >
>
> > _______________________________________________
> > Seaside mailing list
> > Seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
> --
>                                 ___
> .:! DEBIAN GNU/Linux !:.       / _ \
>                               | /   |
>     The universal OS          | \__/
>                                \
> -------------------------------------
> Ma clé GPG est disponible ici :
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE788C34D
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFGMzCygxoTqOeIw00RArLrAJ99OYsBmpPGO9AjSwT6ZtWnHyLyuACgon8h
> dp1qSphlf6J5Z9ITkv9bz3Y=
> =QY7r
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>


More information about the seaside mailing list