20 Jul 06:38
Re: Problem with Checkboxes
From: cdrick <cdrick65 <at> gmail.com>
Subject: Re: Problem with Checkboxes
Newsgroups: gmane.comp.lang.smalltalk.squeak.seaside
Date: 2008-07-20 04:38:29 GMT
Subject: Re: Problem with Checkboxes
Newsgroups: gmane.comp.lang.smalltalk.squeak.seaside
Date: 2008-07-20 04:38:29 GMT
> 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
_______________________________________________ seaside mailing list seaside <at> lists.squeakfoundation.org http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
RSS Feed