Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts Users »

Is this really the best way to handle this problem

Brown, Melonie S. - Contractor

2003-07-15



*sigh* I meant to include the following code snippet before hitting send,
but Outlook had other ideas....
--------------------
<logic-el:iterate name="myList" property="foo" id="foo">
 <c:out value="${foo.description}"/>            
  <html-el:select property="myField" indexed="true" name="foo">

    <html-el:optionsCollection name="theChoices" />
  </html-el:select>
</logic-el:iterate>

-----Original Message-----
From: Brown, Melonie S. - Contractor
Sent: Tuesday, July 15, 2003 1:52 PM
To: 'struts-user@(protected)'
Subject: Is this really the best way to handle this problem


If you have your properties stored in a List() of
whatever-data-object-i-need-in-the-form-of-a-bean, you need to set the
values of the individual items in the list. The following works for me (but
I had to make the form session scoped instead of request to make it work)


See http://jakarta.apache.org/struts/faqs/indexedprops.html




-------- Original Message --------
Subject: Is this really the best way to handle this problem
Date: Tue, 15 Jul 2003 19:28:26 +0200
From: Linus Nikander <linus@(protected)>
Reply-To: Struts Users Mailing List <struts-user@(protected)>
Organization: baseBeans Engineering
Newsgroups: gmane.comp.jakarta.struts.user

I've been struggling with a problem similar to the one described (and
solved) at
http://www.mail-archive.com/struts-user@(protected) .
Is this really the recommended way to solve population / repopulation of
properties stored in a List() of
whatever-data-object-i-need-in-the-form-of-a-bean ? Is there a better way to
acheive the same result ? (I.e represent a collection in a form)

I've read that a practice often used to represent collections (a DB-table
for intstance) is to make a bean that has getters / setters for the
properties of a single row and then have the ActionForm contain a List() of
those beans. One for every row (in the DB-example). That far I can follow,
and see how / why. But is there no better way to update the values in the
ActionForm (beans) when the data is submitted than in the URL above ?

//Linus Nikander - linus@(protected)

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@(protected)
For additional commands, e-mail: struts-user-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.