Rendering in a class hierarchy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Rendering in a class hierarchy

Stephan Eggermont-3
Ok. The basics. Your page renders four parts:

renderContentOn: html
        self renderHeaderOn: html.
        self renderMenuOn: html.
        self renderSynopsisOn: html
        self renderDetailsOn: html.

The first three parts are rendered directly,
all similar to this one:

renderheaderOn: html
        html div
                class; 'pageHeader';
                with: 'Header'

the details component changes, and is tracked
in the detail instance variable of your page.

renderDetailsOn: html
        html div
                id: 'DetailDisplay';
                with: [
                        html render: details]

In the initialize, you have a default detail.

initialize
        super initialize.
        details := MADefaultDetailDisplay new.

The detail is a child.

children
        ^Array with: detail

When you use Announcements:
The detail component posts an Announcement when
something happens that a page might be interested
in. The page subscribes (in initialize) to the Announcements
it is interested in.

Stephan Eggermont



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Rendering in a class hierarchy

Philippe Marschall
2009/11/8 Stephan Eggermont <[hidden email]>:

> Ok. The basics. Your page renders four parts:
>
> renderContentOn: html
>        self renderHeaderOn: html.
>        self renderMenuOn: html.
>        self renderSynopsisOn: html
>        self renderDetailsOn: html.
>
> The first three parts are rendered directly,
> all similar to this one:
>
> renderheaderOn: html
>        html div
>                class; 'pageHeader';
>                with: 'Header'
>
> the details component changes, and is tracked
> in the detail instance variable of your page.
>
> renderDetailsOn: html
>        html div
>                id: 'DetailDisplay';
>                with: [
>                        html render: details]
>
> In the initialize, you have a default detail.
>
> initialize
>        super initialize.
>        details := MADefaultDetailDisplay new.
>
> The detail is a child.
>
> children
>        ^Array with: detail
>
> When you use Announcements:
> The detail component posts an Announcement when
> something happens that a page might be interested
> in. The page subscribes (in initialize) to the Announcements
> it is interested in.

+1
way to go

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Rendering in a class hierarchy

Julian Fitzell-2
On Sun, Nov 8, 2009 at 5:05 AM, Philippe Marschall
<[hidden email]> wrote:

> 2009/11/8 Stephan Eggermont <[hidden email]>:
>> Ok. The basics. Your page renders four parts:
>>
>> renderContentOn: html
>>        self renderHeaderOn: html.
>>        self renderMenuOn: html.
>>        self renderSynopsisOn: html
>>        self renderDetailsOn: html.
>>
>> The first three parts are rendered directly,
>> all similar to this one:
>>
>> renderheaderOn: html
>>        html div
>>                class; 'pageHeader';
>>                with: 'Header'
>>
>> the details component changes, and is tracked
>> in the detail instance variable of your page.
>>
>> renderDetailsOn: html
>>        html div
>>                id: 'DetailDisplay';
>>                with: [
>>                        html render: details]
>>
>> In the initialize, you have a default detail.
>>
>> initialize
>>        super initialize.
>>        details := MADefaultDetailDisplay new.
>>
>> The detail is a child.
>>
>> children
>>        ^Array with: detail
>>
>> When you use Announcements:
>> The detail component posts an Announcement when
>> something happens that a page might be interested
>> in. The page subscribes (in initialize) to the Announcements
>> it is interested in.
>
> +1
> way to go

Yup, great code sample.

Julian
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside