Well, there's the tradeoff.  If you have the logic in code, then you'll
likely need a subclass for each "instance".  I would think it would be
annoying to build almost all of a DynaActionForm in XML, then have to
associate it with a subclass for the "reset" functionality.  I believe,
in general, the "logic" involved here is relatively simple.  In most
cases, you would have a "test" element for each "page" of your wizard,
each of which would reset different fields.  As your form bean starts to
get larger, with more fields to reset, the value of even using
DynaActionForm by itself starts to decrease, and would point you to a
"static" form bean class.

> -----Original Message-----
> From: David Graham [mailto:dgraham1980@;hotmail.com]
> Sent: Monday, November 11, 2002 12:57 PM
> 
> Interesting, but then you're creating a programming language 
> in XML.  I 
> think this logic should be in code.
> 
> David
> 
> >From: "Karr, David" <[EMAIL PROTECTED]>
> >
> >This may seem far out, but what if the "reset" functionality 
> could be 
> >entirely specified in the "form-bean" element?
> >
> >For instance, the "reset" element could contain a set of 
> elements named 
> >"test", each of which would have attributes "field" and 
> "value".  The 
> >"test" element would have "field" subelements, which take a "name" 
> >attribute, and an optional "value" attribute.
> >
> >The "reset" and "test" elements would work like a "switch" 
> statement (or 
> >if-elseif).  It would "evaluate" each of the "test" 
> elements, comparing the 
> >value of the "field" (which has to be a "form-property" of 
> the form) with 
> >the "value".  If they are equal, then the encapsulated 
> "field" elements 
> >would all be "reset", either to a standard "zero" value for 
> each type, or 
> >to the optional "value" attribute of the "field" element.
> >
> >The names of these elements and attributes aren't important, but the 
> >structure is.  This solution would require no application-specific 
> >subclasses.

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>

Reply via email to