true
html:text name=myField property=myProperty/
is the good way ...
On Tue, 25 Jan 2005 18:15:06 +0100, Olasoji Ajayi [EMAIL PROTECTED] wrote:
i thought the property attribute is required in the html:text tag.
- Original Message -
From: Cedric Levieux [EMAIL PROTECTED]
To: Struts Users Mailing List user@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 [EMAIL PROTECTED]
To: Struts Users Mailing List user@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 [EMAIL PROTECTED]
To: Struts Users Mailing List user@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 [EMAIL PROTECTED]
To: Struts Users Mailing List user@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 [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,