struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <hus...@apache.org>
Subject Re: Are form tags tied to beans?!!!
Date Tue, 31 Jul 2001 13:28:47 GMT
What elegant way did you have in mind?

Personally, I'd either add a property to the bean to represent the flag,
or send a second ActionForm bean down as a helper and specify that as
the name attribute for the tag.

If the value is dynamic, it has to be coming from somewhere, so why not
an ActionForm bean?

Jonathan Asbell wrote:
> 
> I know.  This is what I had and didnt like.  So we are saying that we need
> to re-design the html form tags to handle this in an elegant way, right?
> 
> ----- Original Message -----
> From: "Ted Husted" <husted@apache.org>
> To: <struts-user@jakarta.apache.org>
> Sent: Tuesday, July 31, 2001 7:12 AM
> Subject: Re: Are form tags tied to beans?!!!
> 
> > If you want the value of a control to be dynamic and determined from an
> > object other than an ActionForm, then use bean:write
> >
> > <input type="hidden" value="<bean:write ... />">
> >
> >
> > Jonathan Asbell wrote:
> > >
> > > Yes I know, but I want some of the attributes to be dynamic
> > >
> > > ----- Original Message -----
> > > From: "Ted Husted" <husted@apache.org>
> > > To: <struts-dev@jakarta.apache.org>; <struts-user@jakarta.apache.org>
> > > Sent: Monday, July 30, 2001 8:56 PM
> > > Subject: Re: Are form tags tied to beans?!!!
> > >
> > > > You can mix and match the html:form tags with the standard HTML form
> > > > tags. So, just code <input type="hidden" .. into your form.
> > > >
> > > > The html:form tags are a handy way to prepopulate the HTML form
> elements
> > > > from a bean. But they are only a means to an end. If you don't need to
> > > > prepopulate the field, then you don't need to use a html:form tag.
> > > >
> > > > If for any reason you wanted to pass a "flag" bean to your form, to
> set
> > > > that dynamically, you could also pass a second form ActionForm bean.
> The
> > > > default is to use the bean tied to the Action path, but you can also
> > > > overide that on a tag by tag basis.
> > > >
> > > > > Jonathan wrote:
> > > > >
> > > > > I need to dynamically fill a form with values.  The problem is that
> > > > > <html:text> and other form tags REQUIRE the attribute "property".
> > > > > However, there may be fields that I submit that I DONT want to be
> > > > > values in the bean.  For example, I may want to add a hidden field
> > > > > that is NOT a value in the bean, but merely a "flag" in the request.
> > > > > How is this done in a clean way, considering that the form tags all
> > > > > require "property" as an attribute, and that value must be a member
> > > > > value in a bean?
> > > >
> >

Mime
View raw message