[Seaside] Collecting form input
sebnozzi at googlemail.com
Wed Oct 8 08:28:37 UTC 2008
thanks for your reply.
> You could also use ValueHolders but that gets quite ugly. I'd use
> instance variables and split it up.
I'll look into ValueHolders (never heard of them; but I'm a newbie... so...)
What do you mean by the latter? Because it was with instance variables
that I first tried, but as I said it didn't work:
| newName newSalutation |
form: [html textInput value: 'type name here';
callback: [:name | newName := name].
html select list: salutations;
callback: [:userSalutation| newSalutation :=
labels: [:userSalutation | userSalutation asString].
callback: [self addUserNamed: newName
value: 'Add New User']
When the callback in the submitButton was called, "newName" and
"newSalutation" were nil.
What I was trying to do is to avoid creating a temporary user
instance, and only create it when the user submits the data (the user
could instead opt to go back).
But I think I might be overcomplicating things and I might just create
the temporary instance, since I'm creating a Dictionary anyway...
More information about the seaside