--- Nathan Bubna <[EMAIL PROTECTED]> wrote:
> Tim said:
> ...
> > I guess now I'm starting to think I like the lazy idea of every
> form being
> > $form.*
> > instead of $MyWidgetForm, $MyStupidForm, etc.
>
> it is tempting, eh? i'm just not convinced it's a good idea. maybe
> something like $form.field('username') would be better than the
> $form.bean
> bit.
>
> > > that said, back in the day, i lobbied for using reflection
> > > trickery to pull of $form.* and now i can't recall the
> > > arguments involved. hmm. offhand, that could cause trouble
> > > if someone had a method in their ActionForm that collided
> > > with one of the standard FormTool methods.
> >
> > Ok. Understood. We could just change the tool key to $formtool and
> then
> > forms could be either $MyStupidForm or just $form as built-in
> alias. That
> > trickery must be possible in the backend since a few emails back we
> were
> > talking about doing it in the front end view, right? i.e. #set
> ($myform =
> > $form.bean)
>
> -1
> aesthetically, i weary of the oh-so-generic 'tool' being in names.
> the
> current #set( $defaults = $form.bean ) is trivial and optional.
> also, it
> provides free choice of context keys. automatically setting $MyForm
> to
> $form would hard-code another context key.
>
> > BTW - Anybody figure out if multiple forms might exist which would
> screw
> > that default alias trick up a bit?
>
> you can put multiple forms on a page, but you can only submit one at
> a time,
> so afaik, struts only supports one form-bean per action mapping.
>
The DTD for struts 1.0 and 1.1 has the form bean as an attribute, of
which there can only be one. Therefore, your individual _action_ can
only have one form; however, if is possible that a single display page
could be used as the output of more than one action, with the potential
for different forms. This would really be ugly, in that you would need
to code the page itself to detect which form it was working
on...clearly not a good practice. Either way, it would not screw up the
default alias trick.
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]