You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hubert Rabago <hr...@gmail.com> on 2005/01/24 16:18:58 UTC
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
On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi <so...@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
Re: A table on a form from a List of Lists
Posted by Olasoji Ajayi <so...@yahoo.com>.
but the object "myField" is a String and not a bean
----- Original Message -----
From: "Cédric Levieux" <jo...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, January 26, 2005 11:30 AM
Subject: Re: A table on a form from a List of Lists
> true
>
> <html:text name="myField" property="myProperty"/>
>
> is the good way ...
>
>
>
> On Tue, 25 Jan 2005 18:15:06 +0100, Olasoji Ajayi <so...@yahoo.com>
> wrote:
>> i thought the property attribute is required in the html:text tag.
>> ----- Original Message -----
>> From: "Cedric Levieux" <jo...@gmail.com>
>> To: "Struts Users Mailing List" <us...@struts.apache.org>
>>
>> Sent: Tuesday, January 25, 2005 6:02 PM
>> Subject: Re: A table on a form from a List of Lists
>>
>> > So if row is a list try this
>> >
>> > <html:form action="/myAction">
>> > <table>
>> > <logic:iterate id="row" name="myForm" properties="listOfRows">
>> > <tr>
>> > <logic:iterate id="myField" name="row">
>> > <td>
>> > <html:text name="myField"/>
>> > </td>
>> > </logic:iterate>
>> > </tr>
>> > </logic:iterate>
>> > </table>
>> > </html:form>
>> >
>> > directly
>> >
>> > ----- Original Message -----
>> > From: "Olasoji Ajayi" <so...@yahoo.com>
>> > To: "Struts Users Mailing List" <us...@struts.apache.org>
>> > Sent: Tuesday, January 25, 2005 5:37 PM
>> > Subject: Re: A table on a form from a List of Lists
>> >
>> >
>> >> the second iterate will treat row like a bean and will try to retrieve
>> >> the
>> >> value of property called list of fields and it will result in an erroe
>> >> because the row is actually a List and not a bean and it does not have
>> >> a
>> >> property called listofFields. and i dont think html:text works without
>> >> a
>> >> property attribute
>> >>
>> >> ----- Original Message -----
>> >> From: "Cedric Levieux" <jo...@gmail.com>
>> >> To: "Struts Users Mailing List" <us...@struts.apache.org>
>> >> Sent: Tuesday, January 25, 2005 5:27 PM
>> >> Subject: Re: A table on a form from a List of Lists
>> >>
>> >>
>> >> > And by this way ?
>> >> >
>> >> > <html:form action="/myAction">
>> >> > <table>
>> >> > <logic:iterate id="row" name="myForm" proprties="listOfRows">
>> >> > <tr>
>> >> > <logic:iterate id="myField" name="row" proprties="listOfFields">
>> >> > <td>
>> >> > <html:text name="myField"/>
>> >> > </td>
>> >> > </logic:iterate>
>> >> > </tr>
>> >> > </logic:iterate>
>> >> > </table>
>> >> > </html:form>
>> >> >
>> >> > but the problem is that you didn't know which row is the parent of a
>> > field
>> >> >
>> >> > ----- Original Message -----
>> >> > From: "Olasoji Ajayi" <so...@yahoo.com>
>> >> > To: "Struts Users Mailing List" <us...@struts.apache.org>
>> >> > Sent: Tuesday, January 25, 2005 5:02 PM
>> >> > Subject: Re: A table on a form from a List of Lists
>> >> >
>> >> >
>> >> >> 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" <jo...@gmail.com>
>> >> >> To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert
>> > Rabago"
>> >> >> <hr...@gmail.com>
>> >> >> 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" <so...@yahoo.com>
>> >> >> > To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert
>> >> > Rabago"
>> >> >> > <hr...@gmail.com>
>> >> >> > 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" <hr...@gmail.com>
>> >> >> >> To: "Struts Users Mailing List" <us...@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
>> >> >> >> >
>> >> >> >> > On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi
>> >> >> > <so...@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
>> >> >> >> >
>> >> >> >>
>> >> >> >>
>> >> >>
>> >>> ---------------------------------------------------------------------
>> >> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >> >> For additional commands, e-mail: user-help@struts.apache.org
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> > ---------------------------------------------------------------------
>> >> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >> > For additional commands, e-mail: user-help@struts.apache.org
>> >> >> >
>> >> >>
>> >> >>
>> >> >> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >> For additional commands, e-mail: user-help@struts.apache.org
>> >> >>
>> >> >
>> >> >
>> >> > ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> > For additional commands, e-mail: user-help@struts.apache.org
>> >> >
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >>
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: A table on a form from a List of Lists
Posted by Cédric Levieux <jo...@gmail.com>.
true
<html:text name="myField" property="myProperty"/>
is the good way ...
On Tue, 25 Jan 2005 18:15:06 +0100, Olasoji Ajayi <so...@yahoo.com> wrote:
> i thought the property attribute is required in the html:text tag.
> ----- Original Message -----
> From: "Cedric Levieux" <jo...@gmail.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
>
> Sent: Tuesday, January 25, 2005 6:02 PM
> Subject: Re: A table on a form from a List of Lists
>
> > So if row is a list try this
> >
> > <html:form action="/myAction">
> > <table>
> > <logic:iterate id="row" name="myForm" properties="listOfRows">
> > <tr>
> > <logic:iterate id="myField" name="row">
> > <td>
> > <html:text name="myField"/>
> > </td>
> > </logic:iterate>
> > </tr>
> > </logic:iterate>
> > </table>
> > </html:form>
> >
> > directly
> >
> > ----- Original Message -----
> > From: "Olasoji Ajayi" <so...@yahoo.com>
> > To: "Struts Users Mailing List" <us...@struts.apache.org>
> > Sent: Tuesday, January 25, 2005 5:37 PM
> > Subject: Re: A table on a form from a List of Lists
> >
> >
> >> the second iterate will treat row like a bean and will try to retrieve
> >> the
> >> value of property called list of fields and it will result in an erroe
> >> because the row is actually a List and not a bean and it does not have a
> >> property called listofFields. and i dont think html:text works without a
> >> property attribute
> >>
> >> ----- Original Message -----
> >> From: "Cedric Levieux" <jo...@gmail.com>
> >> To: "Struts Users Mailing List" <us...@struts.apache.org>
> >> Sent: Tuesday, January 25, 2005 5:27 PM
> >> Subject: Re: A table on a form from a List of Lists
> >>
> >>
> >> > And by this way ?
> >> >
> >> > <html:form action="/myAction">
> >> > <table>
> >> > <logic:iterate id="row" name="myForm" proprties="listOfRows">
> >> > <tr>
> >> > <logic:iterate id="myField" name="row" proprties="listOfFields">
> >> > <td>
> >> > <html:text name="myField"/>
> >> > </td>
> >> > </logic:iterate>
> >> > </tr>
> >> > </logic:iterate>
> >> > </table>
> >> > </html:form>
> >> >
> >> > but the problem is that you didn't know which row is the parent of a
> > field
> >> >
> >> > ----- Original Message -----
> >> > From: "Olasoji Ajayi" <so...@yahoo.com>
> >> > To: "Struts Users Mailing List" <us...@struts.apache.org>
> >> > Sent: Tuesday, January 25, 2005 5:02 PM
> >> > Subject: Re: A table on a form from a List of Lists
> >> >
> >> >
> >> >> 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" <jo...@gmail.com>
> >> >> To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert
> > Rabago"
> >> >> <hr...@gmail.com>
> >> >> 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" <so...@yahoo.com>
> >> >> > To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert
> >> > Rabago"
> >> >> > <hr...@gmail.com>
> >> >> > 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" <hr...@gmail.com>
> >> >> >> To: "Struts Users Mailing List" <us...@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
> >> >> >> >
> >> >> >> > On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi
> >> >> > <so...@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
> >> >> >> >
> >> >> >>
> >> >> >>
> >> >>
> >>> ---------------------------------------------------------------------
> >> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> >> For additional commands, e-mail: user-help@struts.apache.org
> >> >> >>
> >> >> >
> >> >> >
> >> >> > ---------------------------------------------------------------------
> >> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> > For additional commands, e-mail: user-help@struts.apache.org
> >> >> >
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> For additional commands, e-mail: user-help@struts.apache.org
> >> >>
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> > For additional commands, e-mail: user-help@struts.apache.org
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: A table on a form from a List of Lists
Posted by Olasoji Ajayi <so...@yahoo.com>.
i thought the property attribute is required in the html:text tag.
----- Original Message -----
From: "Cedric Levieux" <jo...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, January 25, 2005 6:02 PM
Subject: Re: A table on a form from a List of Lists
> So if row is a list try this
>
> <html:form action="/myAction">
> <table>
> <logic:iterate id="row" name="myForm" properties="listOfRows">
> <tr>
> <logic:iterate id="myField" name="row">
> <td>
> <html:text name="myField"/>
> </td>
> </logic:iterate>
> </tr>
> </logic:iterate>
> </table>
> </html:form>
>
> directly
>
> ----- Original Message -----
> From: "Olasoji Ajayi" <so...@yahoo.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Tuesday, January 25, 2005 5:37 PM
> Subject: Re: A table on a form from a List of Lists
>
>
>> the second iterate will treat row like a bean and will try to retrieve
>> the
>> value of property called list of fields and it will result in an erroe
>> because the row is actually a List and not a bean and it does not have a
>> property called listofFields. and i dont think html:text works without a
>> property attribute
>>
>> ----- Original Message -----
>> From: "Cedric Levieux" <jo...@gmail.com>
>> To: "Struts Users Mailing List" <us...@struts.apache.org>
>> Sent: Tuesday, January 25, 2005 5:27 PM
>> Subject: Re: A table on a form from a List of Lists
>>
>>
>> > And by this way ?
>> >
>> > <html:form action="/myAction">
>> > <table>
>> > <logic:iterate id="row" name="myForm" proprties="listOfRows">
>> > <tr>
>> > <logic:iterate id="myField" name="row" proprties="listOfFields">
>> > <td>
>> > <html:text name="myField"/>
>> > </td>
>> > </logic:iterate>
>> > </tr>
>> > </logic:iterate>
>> > </table>
>> > </html:form>
>> >
>> > but the problem is that you didn't know which row is the parent of a
> field
>> >
>> > ----- Original Message -----
>> > From: "Olasoji Ajayi" <so...@yahoo.com>
>> > To: "Struts Users Mailing List" <us...@struts.apache.org>
>> > Sent: Tuesday, January 25, 2005 5:02 PM
>> > Subject: Re: A table on a form from a List of Lists
>> >
>> >
>> >> 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" <jo...@gmail.com>
>> >> To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert
> Rabago"
>> >> <hr...@gmail.com>
>> >> 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" <so...@yahoo.com>
>> >> > To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert
>> > Rabago"
>> >> > <hr...@gmail.com>
>> >> > 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" <hr...@gmail.com>
>> >> >> To: "Struts Users Mailing List" <us...@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
>> >> >> >
>> >> >> > On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi
>> >> > <so...@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
>> >> >> >
>> >> >>
>> >> >>
>> >>
>>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> >> For additional commands, e-mail: user-help@struts.apache.org
>> >> >>
>> >> >
>> >> >
>> >> > ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> > For additional commands, e-mail: user-help@struts.apache.org
>> >> >
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >>
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: A table on a form from a List of Lists
Posted by Cedric Levieux <jo...@gmail.com>.
So if row is a list try this
<html:form action="/myAction">
<table>
<logic:iterate id="row" name="myForm" properties="listOfRows">
<tr>
<logic:iterate id="myField" name="row">
<td>
<html:text name="myField"/>
</td>
</logic:iterate>
</tr>
</logic:iterate>
</table>
</html:form>
directly
----- Original Message -----
From: "Olasoji Ajayi" <so...@yahoo.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, January 25, 2005 5:37 PM
Subject: Re: A table on a form from a List of Lists
> the second iterate will treat row like a bean and will try to retrieve the
> value of property called list of fields and it will result in an erroe
> because the row is actually a List and not a bean and it does not have a
> property called listofFields. and i dont think html:text works without a
> property attribute
>
> ----- Original Message -----
> From: "Cedric Levieux" <jo...@gmail.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Tuesday, January 25, 2005 5:27 PM
> Subject: Re: A table on a form from a List of Lists
>
>
> > And by this way ?
> >
> > <html:form action="/myAction">
> > <table>
> > <logic:iterate id="row" name="myForm" proprties="listOfRows">
> > <tr>
> > <logic:iterate id="myField" name="row" proprties="listOfFields">
> > <td>
> > <html:text name="myField"/>
> > </td>
> > </logic:iterate>
> > </tr>
> > </logic:iterate>
> > </table>
> > </html:form>
> >
> > but the problem is that you didn't know which row is the parent of a
field
> >
> > ----- Original Message -----
> > From: "Olasoji Ajayi" <so...@yahoo.com>
> > To: "Struts Users Mailing List" <us...@struts.apache.org>
> > Sent: Tuesday, January 25, 2005 5:02 PM
> > Subject: Re: A table on a form from a List of Lists
> >
> >
> >> 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" <jo...@gmail.com>
> >> To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert
Rabago"
> >> <hr...@gmail.com>
> >> 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" <so...@yahoo.com>
> >> > To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert
> > Rabago"
> >> > <hr...@gmail.com>
> >> > 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" <hr...@gmail.com>
> >> >> To: "Struts Users Mailing List" <us...@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
> >> >> >
> >> >> > On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi
> >> > <so...@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
> >> >> >
> >> >>
> >> >>
> >>
>> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> >> For additional commands, e-mail: user-help@struts.apache.org
> >> >>
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> > For additional commands, e-mail: user-help@struts.apache.org
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: A table on a form from a List of Lists
Posted by Olasoji Ajayi <so...@yahoo.com>.
the second iterate will treat row like a bean and will try to retrieve the
value of property called list of fields and it will result in an erroe
because the row is actually a List and not a bean and it does not have a
property called listofFields. and i dont think html:text works without a
property attribute
----- Original Message -----
From: "Cedric Levieux" <jo...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, January 25, 2005 5:27 PM
Subject: Re: A table on a form from a List of Lists
> And by this way ?
>
> <html:form action="/myAction">
> <table>
> <logic:iterate id="row" name="myForm" proprties="listOfRows">
> <tr>
> <logic:iterate id="myField" name="row" proprties="listOfFields">
> <td>
> <html:text name="myField"/>
> </td>
> </logic:iterate>
> </tr>
> </logic:iterate>
> </table>
> </html:form>
>
> but the problem is that you didn't know which row is the parent of a field
>
> ----- Original Message -----
> From: "Olasoji Ajayi" <so...@yahoo.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Tuesday, January 25, 2005 5:02 PM
> Subject: Re: A table on a form from a List of Lists
>
>
>> 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" <jo...@gmail.com>
>> To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert Rabago"
>> <hr...@gmail.com>
>> 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" <so...@yahoo.com>
>> > To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert
> Rabago"
>> > <hr...@gmail.com>
>> > 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" <hr...@gmail.com>
>> >> To: "Struts Users Mailing List" <us...@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
>> >> >
>> >> > On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi
>> > <so...@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
>> >> >
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail: user-help@struts.apache.org
>> >>
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: A table on a form from a List of Lists
Posted by Cedric Levieux <jo...@gmail.com>.
And by this way ?
<html:form action="/myAction">
<table>
<logic:iterate id="row" name="myForm" proprties="listOfRows">
<tr>
<logic:iterate id="myField" name="row" proprties="listOfFields">
<td>
<html:text name="myField"/>
</td>
</logic:iterate>
</tr>
</logic:iterate>
</table>
</html:form>
but the problem is that you didn't know which row is the parent of a field
----- Original Message -----
From: "Olasoji Ajayi" <so...@yahoo.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, January 25, 2005 5:02 PM
Subject: Re: A table on a form from a List of Lists
> 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" <jo...@gmail.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert Rabago"
> <hr...@gmail.com>
> 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" <so...@yahoo.com>
> > To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert
Rabago"
> > <hr...@gmail.com>
> > 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" <hr...@gmail.com>
> >> To: "Struts Users Mailing List" <us...@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
> >> >
> >> > On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi
> > <so...@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
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: A table on a form from a List of Lists
Posted by Olasoji Ajayi <so...@yahoo.com>.
Wow, i never thought of that, i will definitly give that a try, i think it
should work
----- Original Message -----
From: "Hubert Rabago" <hr...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, January 25, 2005 5:34 PM
Subject: Re: A table on a form from a List of Lists
> 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 <so...@yahoo.com>
> 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" <jo...@gmail.com>
>> To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert Rabago"
>> <hr...@gmail.com>
>>
>> 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" <so...@yahoo.com>
>> > To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert
>> > Rabago"
>> > <hr...@gmail.com>
>> > 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" <hr...@gmail.com>
>> >> To: "Struts Users Mailing List" <us...@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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: A table on a form from a List of Lists
Posted by Hubert Rabago <hr...@gmail.com>.
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 <so...@yahoo.com> 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" <jo...@gmail.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert Rabago"
> <hr...@gmail.com>
>
> 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" <so...@yahoo.com>
> > To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert Rabago"
> > <hr...@gmail.com>
> > 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" <hr...@gmail.com>
> >> To: "Struts Users Mailing List" <us...@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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: A table on a form from a List of Lists
Posted by Olasoji Ajayi <so...@yahoo.com>.
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" <jo...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert Rabago"
<hr...@gmail.com>
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" <so...@yahoo.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert Rabago"
> <hr...@gmail.com>
> 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" <hr...@gmail.com>
>> To: "Struts Users Mailing List" <us...@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
>> >
>> > On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi
> <so...@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
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: A table on a form from a List of Lists
Posted by Cedric Levieux <jo...@gmail.com>.
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" <so...@yahoo.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>; "Hubert Rabago"
<hr...@gmail.com>
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" <hr...@gmail.com>
> To: "Struts Users Mailing List" <us...@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
> >
> > On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi
<so...@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
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: A table on a form from a List of Lists
Posted by Olasoji Ajayi <so...@yahoo.com>.
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" <hr...@gmail.com>
To: "Struts Users Mailing List" <us...@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
>
> On Mon, 24 Jan 2005 10:31:59 +0100, Olasoji Ajayi <so...@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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org