struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarrett Grantham" <>
Subject RE: Nested Struts ..Monkey Struts
Date Sun, 19 Jan 2003 21:44:54 GMT
I tried that and I don't understand what is done in the reset method.  You
mentioned that you create a new ArrayList of the specified size(that I have
done without problem); but when u mention populate it with empty child
forms....I don't understand that.  I don't see how we can populate this new
array list with the child forms when the child forms are empty when the page
is submitted.  I have defined in my Form class the following:

private List locationList = new ArrayList();
  public Object[] getLocationList()
      return this.locationList.toArray();

   public void setLocationList( Object[] anLocationArray)
      this.locationList = new ArrayList();
      for( int each = 0; each < anLocationArray.length; each++ )
         locationList.add( anLocationArray[each] );

Now when I set a break point in the reset method of my Location Form and
submit the form, the variable locationList is empty.

Any ideas?


Jarrett Grantham
Razza Solutions
1149 Haleys Way Dr
Buda, Tx 78610

-----Original Message-----
From: Matt Raible []
Sent: Saturday, January 18, 2003 6:37 PM
To: 'Struts Developers List'
Subject: RE: Nested Struts ..Monkey Struts

I have been able to do this successfully - but only by setting a hidden
variable that tells my ParentForm what size the ArrayList for the
ChildForm is.  Then in my reset method, I grab the hidden variable
(indicating size) and create a new ArrayList of the specified size and
populate it with empty child forms.

It seems like quite a workaround - but it works!


> -----Original Message-----
> From: James Nguyen []
> Sent: Saturday, January 18, 2003 2:36 PM
> To: Struts Developers List
> Subject: Re: Nested Struts ..Monkey Struts
> I've also experience this as well. If there's a clear
> explanation of why
> this happens, please share. I have a hunch as to why, but I
> don't know for
> sure. It would be nice to not have to use the session scope just to
> retrieve my form inputs when there's no need for it to be in
> the session scope.
> I'm glad someone else experience this besides me. =)
> James Nguyen
> At 01:44 PM 1/17/2003 -0600, you wrote:
> >I have been using Struts 1.0 for some time now and I was
> wondering if
> >anyone has ever run into this particular problem. I am nesting forms
> >with nested tags(Monkey Struts add on )which works great for
> displaying
> >data using the scope of "request". I understand that nested
> struts is
> >now included in the latest version of Struts 1.1B3. I have
> noticed that
> >when I use a input field such as a text input box and then
> submit the
> >page that has nested forms on it; the nested forms do not
> get rendered
> >to my action class(form param in my perform method). Only
> the top level
> >Parent form is populated; any child forms( a array list in my parent
> >form class) are not populated. If I change the scope to
> session,  then
> >the child form's are populated in my Action class. The difference
> >between Session and Request in this particular example puzzles me.
> >
> >
> >Anyone seen anything like this?
> >
> >Thanks, Jarrett
> >
> >Jarrett Grantham
> >Razza Solutions
> >1149 Haleys Way Dr
> >Buda, Tx 78610
> >512-797-8198
> >
> James Nguyen
> I/T Professional
> 600 Anton Boulevard - Suite 360
> Costa Mesa, California 92626
> "Cogito ergo sum"
>          -Rene Descartes
> --
> To unsubscribe, e-mail:
> <mailto:struts-dev->>
> For
> additional commands,
> e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message