[Seaside] a sidebar which displays another component ?
John Thornborrow
john at pinesoft.co.uk
Thu Apr 26 09:11:37 UTC 2007
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
Pinesoft Computers are registered in England, Registered number: 2914825. Registered office: 266-268 High Street, Waltham Cross, Herts, EN8 7EA
This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com
More information about the seaside
mailing list