struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shyam A <struts_new...@yahoo.com>
Subject Re: Array of text fields generated dynamically - validation problem
Date Sun, 08 Feb 2004 22:51:31 GMT
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, I use
				
<html:text property="candList" size="25"
maxlength="25"/> 

within a <logic:iterate> tag.

My problem is that when a validation error occurs in
the validate() method of my form bean, the text fields
are populated with junk values. The text fields do not
retain the user entered values. However, the user
entered values can be printed out in the validate()
method.

How do I work around this problem?

Any help, suggestions/pointers will be greatly
appreciated.

Thanks,
Shyam



--- Shyam A <struts_newbie@yahoo.com> wrote:
> Hi,
> 
> 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.
> 
> eg.
> Category A
> text field 1
> text field 2
> text field 3
> 
> Category B
> text field 1
> text field 2
> 
> ........
> 
> 
> The issue here is how to handle the values of the
> text
> fields in my form bean. What I plan to do is to have
> a
> String array for the text fields, and also a
> corresponding array of hidden fields, to identify
> the
> category.
> 
> Is this the best way to handle this situation?
> 
> Any help/suggustions/pointers will be greatly
> appreciated.
> 
> Thanks,
> Shyam
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing
> online.
> http://taxes.yahoo.com/filing.html
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

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


Mime
View raw message