If there's talk of having action forms populated by themselves then I wouldn't.

For example you want to create a new record, to instantiate a new form bean you'd perhaps have to save a record to the db, and all this before the user decides what s/he wants to do with it.

niall wrote some classes that could be useful.

http://www.niallp.pwp.blueyonder.co.uk



On 19 Mar 2004, at 11:05, Brendan Richards wrote:

I guess your first place to look would be DynaActionForm - this base
class dynamically creates FormAction objects setting the properties from
the struts-config file.


http://jakarta.apache.org/struts/api/org/apache/struts/action/ DynaAction
Form.html


DynaValidatorActionForm adds validator support to this.

Perhaps you could extend this class to add your own methods for
specifying form properties on the fly.

The key function seems to be initialize(FormBeanConfig) - FormBeanConfig
"represents the configuration information of a <form-bean> element in a
Struts configuration file".


So create a FormBeanConfig object in code to represent the dynamic data
you want and then initialize a DynaActionForm with this object.

Add properties to FormBeanConfig with addFormPropertyConfig.

That sounds like a realistic starting point...

Anyone else have any ideas suggestions or corrections?




-----Original Message----- From: Melonie Brown [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 18:30 To: [EMAIL PROTECTED] Subject: Database backed forms

I have written a very rough website page content
management system using Struts and OJB. (The goal
being to allow end users to modify content without
having to know anything about Struts or the code
behind the pages.)

That's working all well and good, but now they want to
be able to create forms "on the fly".

I would like to store all of the form components and
validation in the database as well, but I'm not sure
how to represent that in Struts (since there's no
ValidatorActionDatabaseForm).

I would appreciate any advice, tips/techniques, or
gotchas that you guys could provide.

__________________________________
Do you Yahoo!?
Yahoo! Mail - More reliable, more storage, less spam
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to