you can use either indexed or mapped properties in struts for this.
Alternatively the standard request.getParameterNames/getParameterValues
will supply all the data values.
For the mapped properties, use something like:
<input type=text name="prop[<%= rowNum %>]" >
or
<input type=text name="prop{<%= name %>" >
which will call a setProp(rowNum, value) or setProp(name, value)
Note: to use the mapped properties (indexed by name) you need to use
either BeanUtils from Commons or get a nightly of struts.
Ken
-----Original Message-----
From: arikl
Sent: 07 February 2002 10:30
To: struts-user
Cc: arikl
Subject: RE: Dynamic Property.
Sorry, I think that I didn't make my self clear,
Say I have two fields DB
- Name
- Value
the values are my form fields so, how can I make a setter and
getter
form methods if I don't know what fields name I'm gonna get?
-----Original Message-----
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 12:19 PM
To: Struts Users Mailing List
Subject: Re: Dynamic Property.
Populating the fields you plan to retrieve from the database is not a
problem.
The Action handles the retrieval, populates the ActionForm, and sends it
along to the presentation page.
The ActionForm properties correspond to columns in the result set.
"Arik Levin ( Tikal )" wrote:
>
> Yes, I mean buy "dynamic Property" that I'm getting the fields dynamic
from
> my database, so how can I do it? Because at the current release I
can't do
> it, so do u have some suggestions how to do it anyway?
>
> Thanx.
>
> -----Original Message-----
> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 07, 2002 11:55 AM
> To: Struts Users Mailing List
> Subject: Re: urgent!!!! HELP!!!! I have application to go... Dynamic
> Property.
>
> Personally, I'm never quite sure what people mean by "dynamic forms".
>
> Are these being used with a "dynamic database" that creates fields on
> the fly?
>
> Given all the scriptlets, it's hard to tell what's wrong with your
code.
> Most often Struts pages are written using custom tags, with the
> occaisonal runtime expression to plug a gap.
>
> For more about building applications with Struts, see
>
> http://jakarta.apache.org/struts/userGuide/index.html
>
> and
>
> http://www.husted.com/struts
>
> For more about how releases are scheduled, see
>
> http://jakarta.apache.org/struts/userGuide/kickstart.html#release
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Java Web Development with Struts.
> -- Tel +1 585 737-3463.
> -- Web http://www.husted.com/struts/
>
> "Arik Levin ( Tikal )" wrote:
> >
> > Hello out there...
> >
> > I asked this question yesterday, but with no luck. No a
single
> > comment.
> >
> > can anybody help me with this ???? HELP !!!!
@#@#@#@#####
> >
> >
> >
> >
> > Hi everybody.
> >
> > I'm new at struts, but I have tried it and It's just what our
> company
> > wants to our project, and hey... you did a great job.
> >
> > BUT, I have to use some dynamic property because a lot of
forms at
> our
> > app. is dynamic. Thus, I have found at the mailing list a
> > DynamicProperty zip file so... I have compiled it to the struts jar
and
> did
> > the example but I have this small problem.
> >
> >
> > At this section:
> >
> >
> > <jsp:useBean id="mainForm" type="xtest.actions.DynPropForm"
> > scope="session"/>
> >
> > <html:form action="/xtest/jsp/inputDetails.do" method="get">
> >
> > <% for (java.util.Iterator iter =
> > mainForm.allDynamicPropertyNames().iterator(); iter.hasNext(); ) {
> > String propName = (String)iter.next(); %>
> > <%=propName%>: <html:text property="<%=propName%>"/><br>
> > <%
> > }
> > %>
> >
> >
> > I get an Exception: blab la...." Could instantiate bean
> > 'mainForm', neither 'class' nor 'beanName' were specified " bla..
bla..
> >
> > So as I see it, the bean thru struts is not in session
scope,
> so
> > I don't have this bean so I'm ...beeep!
> >
> >
> > If someone out there can help me with this issue , it
would
be
> > great, but if not I think I'll have to write something else and I
don't
> want
> > that !!!
> >
> > By the way, is there any chance to know when is the next
> release
> > ??? thanx bye Arik.
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
Visit our website at http://www.ubswarburg.com
This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>