Cameron,

Does the Action that is run when you submit the form have "CourseList"
associated with it?

If that sorts out the issue with not finding "CourseList" then I think
"CourseList" should look like this:

public final class CourseList extends ActionForm
{
  private ArrayList courseList = new ArrayList(6);

 public ArrayList getCourseList() {
  return(this.courseList);
 }

 public void setCourseList(ArrayList courseList) {
  this.courseList = courseList;
 }

 public CourseForm getCourseList(int index) {
  return (CourseForm)courseList.get(index);
 }

}

Then in your "CourseForm" bean you need setters for all the properties (i.e.
crstitle, crsdept, crshrs, crsnum).

Niall



-----Original Message-----
From: cahana [mailto:[EMAIL PROTECTED]]
Sent: 07 July 2001 21:40
To: [EMAIL PROTECTED]
Subject: indexed properties


Hi everyone-

    I need some help on using the indexed properties for html:text option.
I've implemented Dave Hay's modification and can get the input boxes to show
up using the iterate tag.

<logic:iterate id="course" name="CourseList" property="courseList">
 <tr>
            <td><%= courseNumber++ %></td>
     <td><html:text name="course" property="crstitle" size="25"
maxlength="50" indexed="true"/></td>
     <td><html:text name="course" property="crsdept" size="6" maxlength="9"
indexed="true"/></td>
     <td><html:text name="course" property="crsnum" size="5" maxlength="6"
indexed="true"/></td>
     <td><html:text name="course" property="crshrs" size="5" maxlength="1"
indexed="true"/></td>
 </tr>
 </logic:iterate>

This is what my CourseList bean looks like:

public final class CourseList extends ActionForm
{
  private ArrayList courseList = new ArrayList(6);

 public ArrayList getCourseList() {
  return(this.courseList);
 }

 public void setCourseList(ArrayList courseList) {
  this.courseList = courseList;
 }

 public CourseForm getCourseForm(int index) {
  return (CourseForm)courseList.get(index);
 }

 public void setCourseForm(int index, CourseForm course) {
  this.courseList.add(index, course);
 }
}

The problem i have is that when i try to submit the information and try to
access CourseList.getCourseList(), it bombs and says CourseList cannot be
found. The scope is request. I tried putting it in the session and can
access it that way but it doesn't have the changes that were made on the
form. Anybody know what i'm doing wrong?

thanks,
cameron

Reply via email to