| Author |
Arrays of ActionForms
|
Mike Firkser
Ranch Hand
Joined: Oct 21, 2003
Posts: 246
|
|
I've just started learning Struts, and basically I'm trying to see how I can use it to improve our web app which will soon be going through major revisions. Is there any way for a .jsp page to create an array of ActionForms. For instance, my web app displays a number of lab tests, the number can vary for each patient. I want the user to have the ability to edit any number of these records. Thanks in advance for any ideas.
|
Mike Firkser
Rutgers '84
|
 |
Junilu Lacar
Bartender
Joined: Feb 26, 2001
Posts: 4118
|
|
|
Do the lab forms each have different formats? If they don't, you won't need an array of ActionForms. What you'd normally do is first present a list of available forms in a table. The user would then click on one item and "drill down" to the details. If this fit your needs, you'll only need one ActionForm to represent the details view.
|
Junilu - [How to Ask Questions] [How to Answer Questions] [MiH]
|
 |
Jason Menard
Sheriff
Joined: Nov 09, 2000
Posts: 6450
|
|
|
What you want is an ActionForm that has an array or List of Objects. These Objects can be ActionForms. So your main ActionForm that the page uses might contain an attribute which is a List of LabTest action forms.
|
Jason's Blog
|
 |
Jason Menard
Sheriff
Joined: Nov 09, 2000
Posts: 6450
|
|
Originally posted by Junilu Lacar: Do the lab forms each have different formats? If they don't, you won't need an array of ActionForms. What you'd normally do is first present a list of available forms in a table.
This is not true if the UI requires all of these things to be presented on the screen at once. There are countless examples where you would want different instances of the same form repeated on a page. Think of a simple purchase request form for instance. The purchase request form can consist of multiple items which the designer of the UI may deem is more intuitive to place on the same screen at the same time.
|
 |
 |
|
|
subject: Arrays of ActionForms
|
|
|