struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <>
Subject RE: Unclear semantics on form use for "wizards"
Date Mon, 11 Nov 2002 20:22:44 GMT
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.

> -----Original Message-----
> From: Jason Rosen []
> Sent: Monday, November 11, 2002 12:05 PM
> The reset() method lives in the ActionForm class.  In order 
> to have reset() evaluate what to do means overriding reset() 
> by subclassing ActionForm (or some child of ActionForm).  So 
> to have all these different reset() evaluations means having 
> different ActionForm subclasses.  
> Then if you wanted to use a different ActionForm 
> implementation like DynaActionForm or DynaValidatorForm, you 
> start duplicating your reset() code around because Java 
> doesn't allow for multiple inheritance.  This is the mess I 
> started finding myself in - some of my Actions were using 
> DynaActionForms, some were using DyanValidatorForms, and some 
> were ActionForms but I needed similar reset() functionality 
> in all of them.  So the reset() code was getting hard to maintain. 

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message