[jala-dev] Re: AW: Further feedback on jala.Form

  • From: <robert.gaggl@xxxxxx>
  • To: <jala-dev@xxxxxxxxxxxxx>
  • Date: Thu, 10 May 2007 16:10:10 +0200

hi tobi,

> > i find it confusing to define the default getter/setter for
> > components in the form object, where it's actually neither used nor
> > needed (getValue/setValue is currently defined in 
> jala.Form.Component
> > where it imo belongs to). plus it adds quite some 
> intransparency to a
> > component's behaviour, as you'll have to keep the fallback 
> in mind.  
> This is in fact a strong argument against my suggestion.
> However, actually, you always have to keep a fallback in mind 
> because there are already invisible default setter and getter 
> methods, ie. those used when a even a  component hasn't the 
> corresponding method defined.
> Thus, I think it's justified to provide a hook to overwrite 
> these hidden default methods as well.

The standard getValue/setValue functions are defined in
jala.Form.Component.Input (i mixed that up in my previous mail), and all
other components inherit them - so afais it's impossible to override
them on a per-instance basis (meaning that within one form instance all
components use a different getter/setter that was specified outside the

The current behaviour is imo easy to grasp: either you define a
getter/setter for a component, or the component will look for a property
with the component's name in the data object. So i'd vote to keep it
that way.


Other related posts: