struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@blueyonder.co.uk>
Subject Re: Can I specify DynaFormProperties at Run Time
Date Sat, 01 May 2004 02:10:58 GMT
I developed LazyDynaBean  and LazyDynaClass (which implements
MutableDynaClass) which don't need their properties to be pre-defined.

I have also used them to create LazyValidatorForm which is a version of
DynaValidatorForm backed by a LazyDynaBean.

All thats needed in the struts-config.xml is:

       <form-beans>
           <form-bean name="myForm"
               type="lib.framework.struts.LazyValidatorActionForm"/>
       </form-beans>

Source Code is here: http://www.niallp.pwp.blueyonder.co.uk

Niall

----- Original Message ----- 
From: "Joe Germuska" <Joe@Germuska.com>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, April 30, 2004 6:54 PM
Subject: Re: Can I specify DynaFormProperties at Run Time


> At 8:24 AM -0700 4/30/04, Steve Lewis wrote:
> >Given that the Dynaform is dynamic I am wondering why I need to
> >declare a dynaform and list its properties in struts-config. I would
> >prefer to have my action populate a form adding properties that it
> >knows without having to declare the form in struts-config.
> >1) Is this possible
> >2) If so how do you do that?
> >3) Is anyone doing this?
>
> It's difficult to do because of the process by which dynabeans are
> defined and managed.  One of my colleagues worked on a project where,
> in one case,  form fields were defined by database data.  We
> implemented this with a PlugIn which, at initialization time,
> registered its own dynaforms using the static
> DynaActionFormClass.createDynaActionFormClass() method.  Even this,
> then, isn't truly dynamic, but that's part of how DynaActionFormClass
> is designed.
>
> I think that we should steer Struts to having one or more ActionForm
> factories which can produce forms in more flexible ways.  I don't
> have any specific design ideas in mind, but I've seen how annoying it
> is to get instances of DynaForms (for example, if you want to prefill
> a form), as well as the use case we're discussing right now.
>
> As always, I encourage interested Struts users to grab the source
> code and wrap their heads around how Struts works, possibly coming up
> with specific suggestions on how things can be improved (and perhaps
> even patches!) -- the more minds the better...
>
> A simpler solution might be to simply declare a DynaActionForm which
> has a single mapped property.  You could probably get a good bit of
> what you need there with less investment.
>
> Joe
>
> -- 
> Joe Germuska
> Joe@Germuska.com
> http://blog.germuska.com
>        "Imagine if every Thursday your shoes exploded if you tied them
> the usual way.  This happens to us all the time with computers, and
> nobody thinks of complaining."
>              -- Jef Raskin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message