[Seaside] call: vs rendered component
smalloy at gmail.com
Sun Feb 25 23:36:11 UTC 2007
I'm wondering what peoples thoughts are on the usage of call: vs
assigning a Component instance to an ivar then rendering said
I have an SMMain component which represents my ui layout.
renderContentOn: renders the left nav, and the (current) component.
^Array with: component
component := aComponent.
self component: SMHome new.
html div id: 'nav'; with: [ self renderNavOn: html ].
html div id: 'content'; with: [ html render: component ].
html anchor callback: [ self showHome ]; with: 'Stats'.
html anchor callback: [ self showStats ]; with: 'Stats'.
self component: SMStats new.
I'm hoping that how I'm setting the current component is fine. Because
I notice most of the examples I've seen for Seaside use call: rather
than just changing the ivar.
For example, an alternative implementation to showStats:
self component call: SMStats new.
I'm just wondering if either one is as valid as the other.
I guess my line of thinking is, you should use call: when you want to
do something with the returned answer? Where as what I currently want,
is just a placeholder where I can dynamically change the loaded
component, and thus probably shouldn't be using call, because I'm not
making use of #answer/#answer: (and could be creating lots of extra
I searched the archives, but couldn't find any sort of guide like:
"Only use call when you plan to make use of the answered object"
More information about the Seaside