Hello,
I'm trying to use indexed propeties in my form bean
(ActionForm) to handle an array of text fields
generated dynamically. Initially, I used a String[] to
hold the text field values, and had a problem when
validation errors occured in my validate() method,
i.e, the values of the text fields
I have problem with array validation too, I can print the propety values in my action,
but the validation doesn't work when I'm working with array type(ex. String[]). The
validation of required rule returns no error when it's empty.
Is there any special configuration for validating properties
I don't have the code with me right now, but I learned to solve this with the
sample code from:
http://www.developer.com/java/other/article.php/2233591
On your html:text, you need to use the name and property attributes, and
set indexed=true.
This is an excerpt from the article.
c:forEach
Hi,
I use a String[] in my form bean to handle a dynamic
array of text fields.
In my ActionForm, I have
private String[] candList;
public String[] getCandList()
{
return candList;
}
public void setCandList(String[] aCandList)
{
candList = aCandList;
}
In my JSP,
http://jakarta.apache.org/struts/faqs/indexedprops.html
http://www.developer.com/java/other/article.php/2233591
Also,
http://marc.theaimsgroup.com/?l=struts-users=LazyList
- Hubert
--- Shyam A [EMAIL PROTECTED] wrote:
Hi,
I have a scenario in my Struts application, where I
have an array
From: Shyam A [mailto:[EMAIL PROTECTED]
I have a scenario in my Struts application, where I
have an array of text fields grouped by category on a
JSP, and these are generated dynamically.
It looks like a Map to me, with the key being the category, and then a
String[] or ArrayList as the
6 matches
Mail list logo