Well, lists of lists work, but the property to display or set itself
must be a bean with accessors.  It doesn't have to be a standalone
class - it can be an inner class, or a dyna bean.

On Tue, 25 Jan 2005 17:02:11 +0100, Olasoji Ajayi <[EMAIL PROTECTED]> wrote:
> if this works, it will take care of writing the table to the jsp but i need
> an html input type of field so i can also set the properties of the
> ActionForm by editing the fields and submiting the form.
> ----- Original Message -----
> From: "Cedric Levieux" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <user@struts.apache.org>; "Hubert Rabago"
> <[EMAIL PROTECTED]>
> 
> Sent: Tuesday, January 25, 2005 3:36 PM
> Subject: Re: A table on a form from a List of Lists
> 
> > Hi,
> >
> > There is a way :
> >
> > <table>
> > <logic:iterate id="row" name="myForm" proprties="listOfRows">
> >    <tr>
> >    <logic:iterate id="myField" name="row" proprties="listOfFields">
> >        <td>
> >            <bean:write name="myField"/>
> >        </td>
> >    </logic:iterate>
> >    </tr>
> > </logic:iterate>
> > </table>
> >
> > Regards,
> >
> > Cedric
> >
> > ----- Original Message -----
> > From: "Olasoji Ajayi" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <user@struts.apache.org>; "Hubert Rabago"
> > <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 25, 2005 3:25 PM
> > Subject: Re: A table on a form from a List of Lists
> >
> >
> >> the method did not work, i think its because the nested tags deal with
> > beans
> >> nested in beans but this deals with lists in a list in a bean (like a 2
> >> dimensional array), i was hoping if i code the property like
> >> property[row][col], if will call my getter method String getProperty(int
> >> row, int col) since it calls String getProperty(int index) for property
> >> specified as property[index].
> >> all the methods i have used either comes up with the erron no gettter
> > method
> >> for this or that or null attribute.
> >>
> >> i am begining to think there is no way to get/set a two dimentional array
> >> type of data in a form bean other than to make the property also beans.
> >>
> >> i would really appreciate any help because i want to keep my property as
> >> a
> >> list of lists. the form bean is like:
> >>
> >> public class myBean extends ActionForm{
> >>   private List table = new ArrayList();
> >> /// other propeties that are of type string
> >>
> >> public List getTable(){
> >>   return table;
> >> }
> >>
> >> public List getRow(int row){
> >>   return (List)table.get(row);
> >> }
> >>
> >> public String getField(int row, int col){
> >>   return (String)((List)table.get(row)).get(col);
> >> }
> >>
> >> //// and corresponding setter methods
> >>
> >> i wrote the acessor methods this way so i can specify different property
> > to
> >> get different componentof the bean's property.
> >>
> >> the problem i have is how to code a jsp to call the getter/setter methods
> >
> >> with two int arguments, i dont know very much about the bean
> > specification.
> >> can anyone tell me how to code my jsp or ActionForm to get the third
> >> accessor methods called, to populate an html:text or set the ActionForm
> >> property from html:text
> >>
> >>
> >>
> >> ----- Original Message -----
> >> From: "Hubert Rabago" <[EMAIL PROTECTED]>
> >> To: "Struts Users Mailing List" <user@struts.apache.org>
> >> Sent: Monday, January 24, 2005 4:18 PM
> >> Subject: Re: A table on a form from a List of Lists
> >>
> >>
> >> > 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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to