Hello, I have been learning Seaside and I am very interested in the new rendering API and the integrated Ajax support. However, I have run into a point where I am stumped. I am trying to build a simple yes/no poll as a learning experience. Everything displays fine and when don't make a selection I get the result I expect. However I get an error when I make a selection. I would appreciate any pointers on where I have gone wrong. I am running Squeak 3.8 and the latest release of Seaside 2.6. This is the offending code: !URVote methodsFor: 'as yet unclassified' stamp: 'sdm 3/11/2006 23:40'! renderContentOn: html html div class: 'vote'; with: [ html heading: 'Today''s Vote' level: 2. html paragraph class: 'question'; with: 'Are you happy?'. html div id: 'vote'. html radioGroup: [:group | html radioButton group: group; id: 'yesVote'; with: 'Yes'; callback: [ self yesVote ]. html break. html radioButton group: group; id: 'noVote'; with: 'No'; callback: [ self noVote ]. html break]. html button value: 'Vote'; onClick: (html ajax id: 'vote'; triggerCallbackFor: 'yesVote'; triggerCallbackFor: 'noVote'; on: #renderVotesOn: of: self)] ! ! This is the trace back displayed in the browser: Error: key not found
Thank you for your help, Shawn -- Shawn MacIntyre Edmonton, Alberta, Canada _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
> with: 'Yes';
> callback: [ self yesVote ]. > [...] > with: 'No'; > callback: [ self noVote ]. #with: must be always the last message in the cascade, because it triggers to emit the HTML tag to the stream. In you version the callback gets ignored after all, it should work if you swap #with: and #callback: But yes, I should write some tests for all HTML form controls, I not quite sure if they all work properly together with the script.aculo.us framework ;-) Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
On Mar 12, 2006, at 2:01, Lukas Renggli wrote: >> with: 'Yes'; >> callback: [ self yesVote ]. >> [...] >> with: 'No'; >> callback: [ self noVote ]. > > #with: must be always the last message in the cascade, because it > triggers to emit the HTML tag to the stream. In you version the > callback gets ignored after all, it should work if you swap #with: and > #callback: > Thank you very much for your help Lukas! It works perfectly now -- I know I was just miss understand how things worked. Thanks, Shawn -- Shawn MacIntyre Edmonton, Alberta, Canada _______________________________________________ Seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |