[Seaside] Problem with Checkboxes
cdrick
cdrick65 at gmail.com
Sun Jul 20 04:38:29 UTC 2008
> WAComponent subclass: #WASurvey
> instanceVariableNames: 'survey questionsPerPage currentPage'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'questionaire'
>
> survey is a list of questions, questionsPerPage/currentPage should be
> obvious.
>
> The component is rendered like that:
>
> renderContentOn: html
> | first last |
> first := currentPage - 1 * questionsPerPage + 1.
> last := first + questionsPerPage - 1.
> html heading: survey title.
> html text: currentPage; text: '/'; text: self pageCount.
> html form: [
> survey questions from:first to:last do: [ :question | question
> renderContentOn: html ].
another remark:
[:question | html render: question]
"It's important that you use #render:, rather than directly calling
the #renderContentOn: method of the subcomponent. " if question is a
component (then don't forget to use children).
If Question is not a subclass of WAComponent, then implement renderOn:
instead of renderContentOn:
hth
Cédrick
More information about the seaside
mailing list