Search code examples
smalltalkpharoseaside

Seaside - What's the point of implementing #children in a WAComponent when a direct call to "html render:" is made in "renderContentOn: html"?


Whatever >> children
        ^Array with: oneComponent with: anotherComponent.

Later in the code one might have something like this.

Whatever >> renderContentOn: html
        ...
        html render: oneComponent.
        ...
        html render: anotherComponent.

Since I make a call explicitly to render these components, what's the use of having them in #children? Is #children used for anything else?


Solution

  • Seaside depends on #children being correctly implemented for the following callbacks:

    • #updateRoot: to customise the head section of the generated HTML document,
    • #initialRequest: to initialise the component at the beginning of a session,
    • #updateUrl: to modify the current URL,
    • #updateStates: to registers objects for backtracking,
    • as well as to support helper methods like #states, #scripts, and #styles.

    Search the Seaside Book for these methods to learn more about them.