struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hubert Rabago <hrab...@gmail.com>
Subject Re: A table on a form from a List of Lists
Date Mon, 24 Jan 2005 15:18:58 GMT
Take a look at the nested tags.
In your case, your code may end up looking like:

<nested:form action="/myAction">
<table>
  <nested:iterate property="listOfRows">
  <tr>
     <nested:iterate property="listOfFields">
     <td>
        <nested:text property="myField">
     </td>
     </nested:iterate>
  <tr/>
  </nested:iterate>
</table>
</nested:form>

Hubert

On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi <sojibushman@yahoo.com> wrote:
> Hi,
> i have been trying to create a table on my form from a single property in my actionForm.
the property is a List (actually an ArrayList) containg the rows of the table, each element
(i.e row on the table) is represented by a List of Strings representing the fields of the
list. i can code my JSP page to display the contents of the proprety in a table but i cant
get it to set the values of the property from the page on submit. all the efforts has failed,
i my latest effort, i coded the property as property[row][col] but i get an error that dia
is no getter method for property[0][0]. i wrote the access methods like
> String getProperty(int row, int col){
> return  (String)((List)property.get(row)).get(col);
> }
> 
> it did not work, any ideas will be apreciated.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message