[Seaside] Links and Components doubts

John M p3anoman at gmail.com
Fri Oct 24 18:58:22 UTC 2008


The Scriptaculous component SUTabPanel is a pretty cool script enabled
component that works pretty much out of the box. Just call:
SUTabPanel>>add: yourSubComponent label: theMenuString
for each of your sub-components. It puts in all the div tags you need to
make it look pretty and marks the selected tab for CSS highlghting etc.
automagically.

An example can be seen on my  (sorry site for the shameless plug :) Football
Pool <http://chalculator.seasidehosting.st/> website. You can login with
email: guest pwd: football

Regards
Johnny
(Note: to get a "menu" of the links on one line, you have to change the code
to put <span>'s around the list items instead of div's. I THINK I was able
to make that work, but I didnt like it so I changed it back)


On Thu, Oct 23, 2008 at 1:48 PM, Andres Fortier <
andres at lifia.info.unlp.edu.ar> wrote:

> Hi Sebastian,
>                      you may be interested in WANavigation and
> WASimpleNavigation for the menu stuff (I based on those classes to make a
> custom menu).
>
> You may also want to take a look at WADecoration, which can help you to
> decouple the header/footer from the main page:
>
> WADecoration:
> I am an abstract decoration around instances of WAComponent. I can be added
> to aComponent by calling #addDecoration: and I change the basic behaviour or
> look of a component. There are several methods that can be overriden to
> archive this:
>
> - #renderContentOn: to emit xhtml around the decorated component. Call
> #renderOwnerOn: to let the owner emit its output.
> - #processChildCallbacks: to intercept the callback processing of the
> owner.
> - #handleAnswer: to intercept the answer processing.
>
> HTH,
>        Andrés
>
> Sebastian Van Lacke escribió:
>
>>  Hello,
>> I'm from Argentina and I am working on a Seaside project. I don't speak
>> English very well, so I hope you understand...
>>
>> I need to recreate an old site using Seaside, and I and I'm having
>> problems with the structure of the site.
>>
>> My page has a header, menu, and a footer (which are repeated throughout
>> the site) and a body that changes for each page of the site, depending on
>> the option chosen on the menu.
>>
>> CSRootComponent>>renderContentOn: html
>>  html div
>>  id:'allContent';
>>  with:[
>>   html render: header.
>>   html render: menu.
>>   self renderBodyOn: html.
>>   html render: footer.
>>  ]
>>
>>
>> ---------------------------------------------------------------------------------------------
>> The component menu, displays a horizontal menu with links to different
>> pages on the site.
>>
>> CSMenuComponent>>renderContentOn: html
>>  html div
>>  id: 'menu';
>>  with: [
>>   html unorderedList: [
>>    self  renderMenuItemsOn: html.
>>    ].
>>  ].
>>
>> ---------------------------------------------------------------------------------------------
>> CSMenuComponent>>renderMenuItemsOn: html
>>
>>  menuItems do: [:item |
>>  html listItem with: [
>>   html anchor    callback: item value;
>>    with: item key.
>>  ].
>>  ]
>>
>>
>> ----------------------------------------------------------------------------------------------
>> CSMenuComponent>>initialize
>>   super initialize.
>>  menuItems := OrderedCollection new.
>>  self addMenuItem: 'Company Info' withBlock: [ self companyInfo].
>>  self addMenuItem: 'Products' withBlock: [ self products ].
>>  self addMenuItem: 'Downloads' withBlock: [ self downloads ].
>>  self addMenuItem: 'Resources' withBlock: [ self resources ].
>>  self addMenuItem: 'Support' withBlock: [ self support ].
>>  self addMenuItem: 'Contact Us' withBlock: [ self contactUs ].
>>
>>
>> ----------------------------------------------------------------------------------------------
>>
>> where each of the links should display a new page with the same structure
>> as before, but with a different body.
>>
>> It is right to create a component for each link ? For example,
>> CSCompanyInfoComponent for companyInfo link.
>> How I call that component, from CSMenuComponent>>companyInfo method, to
>> render in a new page??
>> I am confused by the fact that I don't have a renderCanvas to speak in
>> that context.
>>
>> Thanks!!!
>>
>> Sebastian
>>
>>
>> Sebastian Van Lacke | Developer |  caesar systems | see clearly. decide
>> smarter.
>>
>> svanlacke at caesarsystems.com  | t: +1.281.598.8790 | t: +54.11.4389.0126 |
>> www.caesarsystems.com
>>
>> This message and any attached documents contain information from Caesar
>> Systems LLC that may be confidential/trade secret and/or privileged.  If you
>> are not the intended recipient, you may not read, copy, distribute or use
>> this information.  If you have received this transmission in error, please
>> notify the sender immediately by telephone or by reply e-mail and then
>> delete this message.
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20081024/913b7177/attachment.htm


More information about the seaside mailing list