[Seaside] What's the difference and why??

Rick Flower rickf at ca-flower.com
Tue Mar 14 18:03:48 UTC 2006

Brian Brown wrote:
> Try thinking of your main entry point (what I referred to as MyWebApp 
> in the example) as box with dividers in it, and your other components 
> are the things that fit into those divided spaces.  So things like 
> mainPage, enrollPage, aboutPage etc. get rendered into one of those 
> divided spaces, likely the biggest space. aboutPage, for example, 
> doesn't render a menu. The menu is rendered as a peer to it in a 
> different "divided space". This follows what I had put in before by 
> way of example for MyWebApp>>renderContentOn:
I can certainly do it that way (hadn't really thought about it that way 
-- perhaps I'm still in the PHP mindset)

>> renderContentOn: html
>>     html divClass: 'sidebar' with: [html render: menuArea].
>>     html divClass: 'contentarea' with: [html render: mainPage].
> the thing that initially gets rendered inside of the div 'contentarea' 
> get's replaced by the menu calls; mainPage doesn't render any menus, 
> and when the menu sends the #call: message to mainPage for say, 
> aboutPage, the menu stuff is still rendered in the 'sidebar'.
Yes, but it sounds like I'd have to refactor my code to only show the 
"current" view in the "content" div.. Initially when the site comes
up they would see the login pane + MOTD (message of the day) -- if they 
then click on the "about" link, they'd get different content.
I initially had it this way but never saw my content for the about page 
since it also had a renderContentOn: method which was
getting replaced by the top-level code mentioned above in your code 
snippet.  Perhaps the best way to keep track of this is
through the use of some sort of state instance variable.. When the user 
presses "about", the callback in the menu object sets
the parent's instance variable to indicate state=about and the top-level 
code renders the content appropriately by examination of said
state variable.  I believe only the top level code would need to deal 
with the state (and the menu object to set the state) and nobody
else would care.

> Is this making any sense?
Yes.. I guess my PHP mindset keeps coming back to the foreground and 
screwing me up once in a while..


-- Rick

More information about the Seaside mailing list