You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ar...@sodebo.fr on 2002/10/18 15:34:27 UTC

ActionForm and ArrayList


Hello,


I have an ActionForm containing an attribute which type is an ArrayList.
In my action "EditAction" where I prepare data for the form all is ok. I
have the right number of elements in my ArrayList when the form is
displayed in my JSP page.

But  in my "SaveAction" called when the form is submited, when I try to
retrieve the data from my ActionForm I have no element in my ArrayList.
However in the other attribute (String type) of the form, I have the right
data.
Why??

Thanks,
Arno




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: ActionForm and ArrayList

Posted by Dan Tran <da...@hotmail.com>.
In your ActionForm define something like this

     String [] _rows;

    String [] getRow() (return _rows)
    void       setRow(String [] rows ) { set _rows = rows ;}


Then in your  jsp, each elements of your array use property="row", you may
want to use logic:iterate

It is the idea

-Good luck
-D
----- Original Message -----
From: <Ar...@sodebo.fr>
To: <st...@jakarta.apache.org>
Sent: Friday, October 18, 2002 6:34 AM
Subject: ActionForm and ArrayList


>
>
> Hello,
>
>
> I have an ActionForm containing an attribute which type is an ArrayList.
> In my action "EditAction" where I prepare data for the form all is ok. I
> have the right number of elements in my ArrayList when the form is
> displayed in my JSP page.
>
> But  in my "SaveAction" called when the form is submited, when I try to
> retrieve the data from my ActionForm I have no element in my ArrayList.
> However in the other attribute (String type) of the form, I have the right
> data.
> Why??
>
> Thanks,
> Arno
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>