[Seaside] [Q] callbacks in forms... or data passing

Avi Bryant avi at beta4.com
Fri Jun 13 13:23:44 CEST 2003


On Fri, 13 Jun 2003, Julian Fitzell wrote:

> Well, you don't necessarily want to add instance variables to your
> components.  It really depends on whether you want changes to be
> instantly reflected in your model objects or whether the user is working
> on data in mulitple steps that should only be applied when the user hits
> 'Done' or something.  Note, if you give #textInputOn:of: a symbol like
> #foo for the first parameter, it will check for methods #foo and #foo:
> and use those if they exist.  If they don't, then it will look for an
> instvar called foo.

It will?  I don't think it does that.  Seaside 0.9x bindings did, for
which I got into lots of trouble from Tim...

As for whether changes are instantly reflected or not - I do often find it
useful for forms not to directly manipulate the model.  That gives
you a chance to do validation, check for concurrent modification, and so
on, before you overwrite the old values.  One way of doing this is to map
each form input to an inst var in the component, and then manually copy
the values in when you know they're ok.  I actually prefer to use
WAModelProxy, which you can wrap around an object.  You treat it as if
it were the model object, but no changes will actually be made to the
original object until you send #commit.

By the way, does anyone know why the list is so slow these days?  My
messages take a very long time to show up...




More information about the Seaside mailing list