[Seaside] Problem with Checkboxes

Felix Dorner felix_do at web.de
Sat Jul 19 23:46:06 UTC 2008


Hey,

first, I am a Squeak/Smalltalk newcomer, so please forgive me if I make 
an obvious error. I also give as much detail as I can and would greatly 
appreciate general comments.

I am trying to write a small survey application, for that I created a 
class WASurvey:

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 ].
        html submitButton text: 'Previous Page';
                              callback: [ currentPage := currentPage - 1 ];
                              disabled: currentPage = 1.
        html submitButton text: 'Next Page';
                              callback: [ currentPage := currentPage + 1 ];
                              disabled: currentPage = self pageCount.
    ]

Now I created several Question classes that implement renderContentOn: 
aCanvas

MultiChoiceQuestion>>renderContentOn: html
super renderContentOn: html.
    answers doWithIndex: [ :answer :index |
                                   | current |
                                   current := html checkbox value: 
(values includes: index).
                                   html text: answer.
                             ]

SingleChoice>>renderContentOn: html
super renderContentOn: html.
    html radioGroup: [ :group |
        answers doWithIndex: [ :e :index |
                                     | current |
                                     current := group radioButton.
                                     value = index ifTrue: [ current 
beChecked ].
                                     html text: e ]
    ]


I currently get a MessageNotUnderstood error that seems to be related to 
the Checkbox components in MultiChoice questions. My problem is, that 
the StackTrace is very deep, and only shows Seaside internals. What 
would now be the general approach to trace down that issue?

Thanks for your help,

Felix

Here is the top of the Stack Trace:

   1.

      thisContext
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&4>
          UndefinedObject(Object)>>doesNotUnderstand: #value:
      self
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&5>
          nil
      aMessage
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&6>
          value: nil

   2.

      thisContext
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&7>
          [] in WACheckboxTag>>after {[callback value: value. value :=
          false]}
      self
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&8>
          a WACheckboxTag

   3.

      thisContext
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&9>
          BlockContext>>valueWithPossibleArgument:
      self
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&10>
          [] in WACheckboxTag>>after {[callback value: value. value :=
          false]}
      anArg
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&11>
          ''

   4.

      thisContext
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&12>
          WAValueCallback>>evaluateWithArgument:
      self
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&13>
          a WAValueCallback
      anObject
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&14>
          ''

   5.

      thisContext
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&15>
          WAValueCallback(WACallback)>>evaluateWithField:
      self
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&16>
          a WAValueCallback
      anObject
      <http://127.0.0.1:8080/seaside/survey?_s=TGzVOKjnplpRtUnu&_k=VXYqwquh&17>
          ''




More information about the seaside mailing list