Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 77648 invoked from network); 3 May 2010 15:15:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 May 2010 15:15:55 -0000 Received: (qmail 49235 invoked by uid 500); 3 May 2010 15:15:53 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 49188 invoked by uid 500); 3 May 2010 15:15:53 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 49167 invoked by uid 99); 3 May 2010 15:15:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 May 2010 15:15:53 +0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=AWL,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mgainty@hotmail.com designates 65.55.111.112 as permitted sender) Received: from [65.55.111.112] (HELO blu0-omc2-s37.blu0.hotmail.com) (65.55.111.112) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 May 2010 15:15:47 +0000 Received: from BLU142-W35 ([65.55.111.73]) by blu0-omc2-s37.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 3 May 2010 08:15:26 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_ebce466a-8867-4060-95b8-52c6af794df5_" X-Originating-IP: [71.232.74.24] From: Martin Gainty To: Struts Users Mailing List Subject: RE: input fields with dynamic names Date: Mon, 3 May 2010 11:15:26 -0400 Importance: Normal In-Reply-To: <4BDED8DD.1010504@claborn.net> References: <4BD866BA.5000703@claborn.net> <4BD87696.2020009@claborn.net>,<4BDED8DD.1010504@claborn.net> MIME-Version: 1.0 X-OriginalArrivalTime: 03 May 2010 15:15:26.0856 (UTC) FILETIME=[75C89880:01CAEAD3] --_ebce466a-8867-4060-95b8-52c6af794df5_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable //The action class contains a (dynamically populated) collection such as pe= rsons defined here @Result(name=3D"list"=2C value=3D"listPeople.action"=2C type=3DServletRedir= ectResult.class) public class EditPersonAction extends ActionSupport { ArrayList persons =3D new ArrayList() } //then the jsp makes reference to persons ArrayList from the action class a= nd references specific rows by utilising stat.index by the s:iterator itera= tor <%-- The following is done Dynamically --%> this would achieve the effect of dynamically populating n number of Person = objects does this answer the question? Martin Gainty=20 ______________________________________________=20 Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de confidentialit= =E9 =20 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaeng= er sein=2C so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiter= leitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient l= ediglich dem Austausch von Informationen und entfaltet keine rechtliche Bin= dungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen w= ir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut =EAtre privil=E9gi=E9. Si vous n'=EAtes= pas le destinataire pr=E9vu=2C nous te demandons avec bont=E9 que pour sat= isfaire informez l'exp=E9diteur. N'importe quelle diffusion non autoris=E9e= ou la copie de ceci est interdite. Ce message sert =E0 l'information seule= ment et n'aura pas n'importe quel effet l=E9galement obligatoire. =C9tant d= onn=E9 que les email peuvent facilement =EAtre sujets =E0 la manipulation= =2C nous ne pouvons accepter aucune responsabilit=E9 pour le contenu fourni= . > Date: Mon=2C 3 May 2010 09:08:29 -0500 > From: mitch@claborn.net > To: user@struts.apache.org > Subject: Re: input fields with dynamic names >=20 > Bump. Any other ideas? >=20 > mitch >=20 >=20 > Mitch Claborn wrote: > > That works for setting parameter names=2C but not so well when the tags= =20 > > in the JSP need to retrieve the value for display in the page=2C=20 > > particularly if there is a validation error. If there is a static=20 > > field named "fred" and the action has a "getFred()" method=2C then all= =20 > > is good. But the field names in my case are dynamic=2C so I can't have= =20 > > a getNNNNN for all of the dynamic fields. > > > > mitch > > > > > > Greg Lindholm wrote: > >> You are probably looking for ParameterAware > >> > >> http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/i= nterceptor/ParameterAware.html=20 > >> > >> > >> > >> On Wed=2C Apr 28=2C 2010 at 12:47 PM=2C Mitch Claborn =20 > >> wrote: > >> =20 > >>> I'm sure I've seen the answer to this somewhere=2C but darned if I ca= n=20 > >>> find it > >>> now when I need it! > >>> > >>> I have a page that allows edits of various options=2C the names of=20 > >>> which are > >>> dynamically retrieved from the database. If I have the code in the=20 > >>> JSP as > >>> below=2C the value displayed in the text field is always that from th= e > >>> database. If there is a validation error=2C the user's input value i= s=20 > >>> not > >>> maintained as it would be if there were an explicit getter/setter=20 > >>> for each > >>> option name. Is there a way to code the Action (or the JSP) so that= =20 > >>> the > >>> value shown is the user's input value if there is an error? > >>> > >>> > >>> >>> id=3D"${o.optionName}" value=3D"${o.valueInt}" /> > >>> > >>> Mitch > >>> > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe=2C e-mail: user-unsubscribe@struts.apache.org > >>> For additional commands=2C e-mail: user-help@struts.apache.org > >>> > >>> > >>> =20 > >> > >> --------------------------------------------------------------------- > >> To unsubscribe=2C e-mail: user-unsubscribe@struts.apache.org > >> For additional commands=2C e-mail: user-help@struts.apache.org > >> > >> > >> =20 > > > > --------------------------------------------------------------------- > > To unsubscribe=2C e-mail: user-unsubscribe@struts.apache.org > > For additional commands=2C e-mail: user-help@struts.apache.org > > > > >=20 > --------------------------------------------------------------------- > To unsubscribe=2C e-mail: user-unsubscribe@struts.apache.org > For additional commands=2C e-mail: user-help@struts.apache.org >=20 =20 _________________________________________________________________ The New Busy is not the old busy. Search=2C chat and e-mail from your inbox= . http://www.windowslive.com/campaign/thenewbusy?ocid=3DPID28326::T:WLMTAGL:O= N:WL:en-US:WM_HMP:042010_3= --_ebce466a-8867-4060-95b8-52c6af794df5_--