Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 92834 invoked from network); 1 May 2004 02:08:59 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 1 May 2004 02:08:59 -0000 Received: (qmail 89440 invoked by uid 500); 1 May 2004 02:08:25 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 89090 invoked by uid 500); 1 May 2004 02:08:23 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 89071 invoked from network); 1 May 2004 02:08:22 -0000 Received: from unknown (HELO smtp-out1.blueyonder.co.uk) (195.188.213.4) by daedalus.apache.org with SMTP; 1 May 2004 02:08:22 -0000 Received: from DELL1800 ([82.43.169.193]) by smtp-out1.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.5600); Sat, 1 May 2004 03:08:32 +0100 Message-ID: <002301c42f21$8b0fc7f0$c1a92b52@DELL1800> From: "Niall Pemberton" To: "Struts Users Mailing List" References: <6.0.1.1.0.20040430082111.0ccc2210@pop.nwlink.com> Subject: Re: Can I specify DynaFormProperties at Run Time Date: Sat, 1 May 2004 03:10:58 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-OriginalArrivalTime: 01 May 2004 02:08:32.0976 (UTC) FILETIME=[34387D00:01C42F21] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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: Source Code is here: http://www.niallp.pwp.blueyonder.co.uk Niall ----- Original Message ----- From: "Joe Germuska" To: "Struts Users Mailing List" 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