You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Caroline Lauferon <ca...@cgey.com> on 2003/12/05 13:30:42 UTC

dynamic number of lines - Indexed properties ?

Hello! 
up to now I had used quite "simple" forms... and now I need some more complicated fields, and don't know where to start from....

Here is what I want to do, with a simple example: I want to describe a family, with all its members: 
- to describe the family common properties: 
Last name: _____ 
Address: _______

- to describe a member: (corresponding to an object FamilyMember having name and age properties, getters and setters)
Name: _________   
Age: __________

But i don't want to decide of the max number of the family..... 
I see 2 options: 
* at first, display just one member's description fields. the user clicks on a button in order display a second member's description fields. (in javascript, it would be quicker, but it will work only if the actionform needn't be changed)
* have the two description fields and some kind of multiple select in which th description values are put using a button (like the swap tag of struts layout, but with no select on the left).
is it feasible with indexed properties (this model would be great, bu i don't what view to use to populate it :-( )

I hope what i need is clear ;-). Ask me if something is not.....
Thanks
Caroline

Re: dynamic number of lines - Indexed properties ?

Posted by Shantanu Deo <sd...@nc.rr.com>.
One way to deal with this is to break it up into two parts, in the first
step ask the user to specify the number of family members and then create
the record and appropriately display the correct number of family members.
Another would be to put a Add Member button on the page and essentially in
the corresponding action, increase the size of the collection that is
iterated over in the JSP to dynamically add (or even delete) family members.

HTH
Shantanu

----- Original Message ----- 
From: "Caroline Lauferon" <ca...@cgey.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, December 05, 2003 7:30 AM
Subject: dynamic number of lines - Indexed properties ?



Hello!
up to now I had used quite "simple" forms... and now I need some more
complicated fields, and don't know where to start from....

Here is what I want to do, with a simple example: I want to describe a
family, with all its members:
- to describe the family common properties:
Last name: _____
Address: _______

- to describe a member: (corresponding to an object FamilyMember having name
and age properties, getters and setters)
Name: _________
Age: __________

But i don't want to decide of the max number of the family.....
I see 2 options:
* at first, display just one member's description fields. the user clicks on
a button in order display a second member's description fields. (in
javascript, it would be quicker, but it will work only if the actionform
needn't be changed)
* have the two description fields and some kind of multiple select in which
th description values are put using a button (like the swap tag of struts
layout, but with no select on the left).
is it feasible with indexed properties (this model would be great, bu i
don't what view to use to populate it :-( )

I hope what i need is clear ;-). Ask me if something is not.....
Thanks
Caroline



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org