Subject: Re: Need Help Struts 2.0.8 2007-11-01 - By Jim Cushing
Back It's not necessary to do declare 10 variables. Here's an example:
http://struts.apache.org/2.x/docs/tabular-inputs.html
By the way, Struts 2.0.11 is out, so Raguveer, you might want to upgrade. The answer to your particular question doesn't change, but there are some bug and security fixes you should have.
On Nov 1, 2007, at 7:14 AM, John Doe wrote:
> The simplest way (if I'have understood your problem right) is to > create 10 > variables in your action class (with getters and setters of course) > and on > the form. So it'll be > > private String firstName1; > private String firstName2; > private String firstName3; > ... > private String firstName10; > > in the action class and : > > <s:textfield name="firstName1" size="25" maxlength ="20"/> > <s:textfield name="firstName2" size="25" maxlength ="20"/> > <s:textfield name="firstName3" size="25" maxlength ="20"/> > ... > <s:textfield name="firstName10" size="25" maxlength ="20"/> > > Struts fills action variables values automatically using reflection. > > On 11/1/07, Raghuveer Rawat <raghuveer.rawat@(protected)> wrote: >> >> Hi, still looking for help. >> >> >> On 10/31/07, Raghuveer Rawat <raghuveer.rawat@(protected)> wrote: >>> >>> Hi, I have form which allows user to invite other users. A user can >> invite >>> a max of 10 users at a time. A row contain First Name, Last Name, >>> and >> Email >>> Address. >>> How should I name these textfields (OGNL expression) and how >>> should I >>> retrieve these values in Action Class? >>> >>> >>> <table> >>> >>> < >>> tr> >>> >>> <td>First Name</ td> >>> >>> <td>Last Name</ td> >>> >>> <td>Email Address</ td> >>> >>> </tr> >>> >>> <tr> >>> >>> <s:textfield name="firstName" size="25" maxlength ="20"/></td> >>> >>> <s:textfield name="lastName" size="25" maxlength ="20"/></td> >>> >>> <s:textfield name="email" size="25" maxlength= "20"/></td> >>> >>> </tr> >>> >>> similarly 9 more rows like this. >>> >>> </table> >>> >>> >>> >> > > > > -- > Best regards, > Bashma??ov Anton
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|