Return-Path: X-Original-To: apmail-struts-user-archive@www.apache.org Delivered-To: apmail-struts-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AA6A41785B for ; Wed, 25 Feb 2015 12:42:12 +0000 (UTC) Received: (qmail 3955 invoked by uid 500); 25 Feb 2015 12:42:11 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 3912 invoked by uid 500); 25 Feb 2015 12:42:11 -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 3900 invoked by uid 99); 25 Feb 2015 12:42:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Feb 2015 12:42:11 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yaragallamurali@gmail.com designates 209.85.216.49 as permitted sender) Received: from [209.85.216.49] (HELO mail-qa0-f49.google.com) (209.85.216.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Feb 2015 12:42:06 +0000 Received: by mail-qa0-f49.google.com with SMTP id w8so2405277qac.8 for ; Wed, 25 Feb 2015 04:40:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=DyiYyz1aK9yYqEq1PifydXJSpFPMTOPGs4EMUo6Cvfc=; b=SddA6e7/T9yS7dm20jVIvUj/lYleL59xaSpSWlX1/MghxhbeJ4EVMldh0hGffGV8aM H9c033L4Aa3BjTrXW6tq2zhwSBtXlu1heByHvJvn1fXx6pbqwymkfSpD4MBFSiKjpg4h 8QDrq3/mX04Zcy/0lDKE6dMpIWqP6FRf8tM8tjGWo6hJtNWbvNnWwE41A/VuEHFH9mUl HqCAKz+RYdN1diu6RZTG8KjeUkLzhnE36L7Hl8LTKW0IYrrTgJWcmIh2YQaSwgt7uD0I oDyDAz01n7fZhXeVPei24L+thErfkEaY1A08VFMV1RHQggVQlHz7J6F42f80QlVZCbq8 ltKg== MIME-Version: 1.0 X-Received: by 10.229.70.201 with SMTP id e9mr6737063qcj.6.1424868016087; Wed, 25 Feb 2015 04:40:16 -0800 (PST) Received: by 10.140.230.69 with HTTP; Wed, 25 Feb 2015 04:40:16 -0800 (PST) In-Reply-To: References: Date: Wed, 25 Feb 2015 18:10:16 +0530 Message-ID: Subject: Re: dynamically generating user input fields From: Yaragalla Muralidhar To: Struts Users Mailing List Content-Type: multipart/alternative; boundary=001a1133c280f36791050fe8ef58 X-Virus-Checked: Checked by ClamAV on apache.org --001a1133c280f36791050fe8ef58 Content-Type: text/plain; charset=UTF-8 Actually i have a "List students " in my action class. but when i am dynamically genaerating fields in html page how to change the names of the fields that are dynamically getting generated? for the first field i gave students[0].name but for the second field that is dynamically getting generated how can i change the name of the field like "students[1].name? *Thanks and Regards,* Muralidhar Yaragalla. *http://yaragalla.blogspot.in/ * On Wed, Feb 25, 2015 at 5:51 PM, Christoph Nenning < Christoph.Nenning@lex-com.net> wrote: > > Hi i have a jsp page with a button "capture student details". when that > > button is pressed it has to display few user input fields on the same > page > > like "student Name", student id and few other fields . now user enters > the > > details of the student and when he press the button again the same set > of > > fields have to appear again in order to capture the 2nd student details. > > how to achieve this? > > > > > > > As member of your action you can use a Map. The Map-Key is > the dynamic field name. You need some JS to generate a new input-field in > the browser. As html-input-name you can use an OGNL expression like > "map['fieldName']". That way struts can set the keys and values in your > action's map. > > > > Regards, > Christoph > > This Email was scanned by Sophos Anti Virus > --001a1133c280f36791050fe8ef58--