[Seaside] Re: Seaside Async and form submission
carlg at libertybasic.com
Wed Feb 18 19:42:40 UTC 2009
On Feb 18, 2009, at 12:59 PM, Carl Gundel wrote:
> I'm using Async with my Run BASIC project. I am still using Seaside
> 2.6, but I plan to migrate forward as soon as I can get my Ajax
> stuff working okay. have a dynamically generated form with a couple
> of listboxes and an anchor. When the link is clicked I am expecting
> the values to get scraped from the controls and assigned to my
> model, but it doesn't seem to be happening. The form is getting
> built and rendered correctly as far as I can tell.
Okay, here is a complete tiny class that seems to exhibit the same
behavior. The counter increments when the anchor is clicked, but the
value of selection is always nil.
Smalltalk defineClass: #AsyncTest
instanceVariableNames: 'list selection counter '
category: 'Run BASIC'!
!AsyncTest class methodsFor: 'as yet unclassified'!
self registerAsApplication: 'asyncTest'.! !
!AsyncTest methodsFor: 'rendering'!
self renderOnHtml: html!
| select anchor |
text: 'Async test';
text: 'Counter = ' , self counter asString;
[select := html select.
select list: self list.
select on: #selection of: self.
anchor := html anchor.
self counter: counter + 1.
self renderOnHtml: h];
html text: self selection]]! !
!AsyncTest methodsFor: 'accessing'!
counter isNil ifTrue: [ counter := 0 ].
counter := anObject!
list isNil ifTrue: [ list := OrderedCollection with: '1' with: 'one'
with: 'won' with: 'Juan' ].
list := anObject!
selection := anObject! !
More information about the seaside