[Seaside] How do I call a method from renderContentOn:
ld
s001 at landr.net
Tue Apr 13 17:18:26 CEST 2004
Julian Fitzell wrote:
> ld wrote:
>
>> I'm new to Seaside. It seems very powerful, if I could just understand
>> it better. I have worked through the tutorial, and thought I'd practice
>> by modifying the WACounter example to change the change 'interval' from
>> the browser.. I added a 'interval' variable. Then added a
>> selectFromList to 'renderContentOn:' to quickly change the interval
>> that the counter is incremented/decremented by.
>>
>> renderContentOn: html
>> html heading: count.
>> html anchorWithAction: [self increment] text: '++'.
>> html space.
>> html anchorWithAction: [self decrement] text: '--'.
>> html break.
>> html horizontalRule.
>> html text: 'Change the interval'.
>> html paragraph.
>> html form: [
>> html selectFromList: (1 to: 10) selected: interval callback:
>> [:i | interval _ i].
>> html submitButton.
>> ].
>> html text: 'how do I call the setInterval from here?'.
>> -------
>> Next, factored the form into a setInterval method:
>>
>> setInterval: html
>> html text: interval.
>> html space.
>> html space.
>> html form: [
>> html selectFromList: (1 to: 10) selected: interval callback:
>> [:i | interval _ i].
>> html submitButton.
>> ]
>> -------
>> My questions are:
>> 1) Is my factoring correct?
>
>
> Should be fine though, by convention, I would rename #setInterval: to
> #renderIntervalOn: or something.
>
>> 2) How do I call this from 'renderContentOn:' ?
>
>
> just call "self setInterval: html" - you keep passing the renderer
> object on down to other rendering methods.
>
>> Thanks for you patience with such simple questions.
>
>
> Not a problem, let us know if you have more.
>
> Julian
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
>
>
Thanks, that was so simple! I do believe learning Seaside will be an
enjoyable experience. And, yes I'm sure I will have more. :)
-Larry
More information about the Seaside
mailing list