The easiest way to do handle a list on a form is with an index. 
Use the <logic:iterate> tag to iterate the list. 
For the checkbox you use something like this:

<input type="checkbox" name='<%= "name[" + index + "]"%>' value='<%= "value[" + index 
+ "]"%>'>

Marcel


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 5:57 PM
To: [EMAIL PROTECTED]
Subject: Defining Form elements based on db ids


I am just starting out with Struts and I am trying to do something fairly
simple.  I have a form with 1 to x number or rows that were retrieved from a
database.  Each one can be selected via a checkbox.  Initially I wanted to
name the checkbox process_xxx where xxx is the key from the database (i.e.
process_345; process_621...) - that way I can easily tell which rows were
selected and do my backend processing.  I don't think I can do this being
that the form class has to have the fields defined beforehand.  What is the
best way to go about what I am trying to do?  Is the indexed attribute
intended for this use?

Thanks,
Mike

--
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]>

Reply via email to