Map backed forms can do this easily. It took me a half day of figuring
out how to make them work with my code, but then it was simple.

I have a ver similar form. I just use three separate Maps:
- one for the type of field it is;
- one for the name/label;
- one for the actual value;
- one for a collection of valid values if its a selection list or set of
redio buttons.

This approach worked for me. I just create the Maps in may action
(obviously they are all keyed by the field/column name). I use JSTL on
the web page to iterate through the maps and create the appropriate
Struts HTML tags.

You could reduce the number of Maps by using a more complex bean (one
that contained properties for the tpe of field, name/label and value,
etc.).

HTH - Richard


> -----Original Message-----
> From: Dean A. Hoover [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 06, 2004 7:47 AM
> To: Struts Users Mailing List
> Subject: Re: very dynamic forms
>
>
> What I need to do is construct a form that has a
> variety of text input forms on it that are determined
> at run-time. I know how to do this in jsp but I need
> to provide an ActionForm that conforms to that form.
> I got several useful replies last night and am
> investigating them.
>
> Dean
>
> Michael McGrady wrote:
>
> > That makes sense, but his other comments seem to negate that.  He
> > says, e.g., that "[w]hat would come out of the query would
> be label,
> > form position, variable name,etc, etc.".  These are things
> that are on
> > the page form, not on some dynamic class handling the form.  He
> > specifically rejects dynamic class structures in fact when he says
> > that he has worked with DynaActionForm and ActionForm and that they
> > don't fit the bill.  I think he is focusing on the idea of having
> > changing variables on the page form and how to handle this on the
> > backend.  Is that right, Dean?
> >
> > Michael
> >
> > At 01:40 AM 8/6/2004, you wrote:
> >
> >> I thought that
> >>
> >> " I want to build one on-the-fly according to "configuration" stuff
> >> stored in a database, that can change. "
> >>
> >> was pretty clear, especially after he pointed out the
> DynaActionForms
> >> weren't what he was looking for because they came from
> struts config.
> >> But maybe it's just me - I'm used to wondering about what
> (weird stuff)
> >> I can do in Struts.
> >>
> >>
> >> > > > >>
> >> > > > >>At 05:00 PM 8/5/2004, you wrote:
> >> > > > >>
> >> > > > >>>Suppose I want to construct a form based
> >> > > > >>>on a query to a database. What would come
> >> > > > >>>out of the query would be label, form position,
> >> > > > >>>variable name, etc, etc. What would be the
> >> > > > >>>recommended way of building this under
> >> > > > >>>struts/tiles? I've been working with struts/tiles
> >> > > > >>>for a while now and this is the first time this
> >> > > > >>>sort of requirement has come up. I've used
> DynaActionForm and
> >> > > > >>>ActionForm, but do not see how this sort of thing
> fits either
> >> > > > >>>model.
> >> > > > >>>
> >> > > > >>>Any ideas?
> >> > > > >>>
> >> > > > >>>Dean Hoover
> >> > > > >>>
> >> > > > >>>
> >> > > >
> >>>-----------------------------------------------------------
> >> > > > ----------
> >> > > > >>>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]
> >> > > > >
> >> > > > >
> >> > > >
> >> > > >
> >> > > >
> >> > > >
> >> >
> --------------------------------------------------------------------
> >> > > > -
> >> > > > 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]
> >> >
> >> >
> >>
> >>
> >>
> ---------------------------------------------------------------------
> >> 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]
>
>
>


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

Reply via email to