This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Arrays of ActionForms Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Arrays of ActionForms" Watch "Arrays of ActionForms" New topic
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
    
    2

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
 
Similar Threads
MapBacked ActionForms and DynaActionForm
web start log location
how many types of listener can we make?
Struts/Tomcat: Implementing Login Overview
Prepopulating a DynaActionForm