Re: Sample code for handling variable number of text fields
Thanks Ted. That should work for me.. - Original Message - From: Ted Husted [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Saturday, June 15, 2002 4:40 PM Subject: Re: Sample code for handling variable number of text fields You can just use an array. private String[] key= null; public String[] getKey() { return this.key; } public void setKey(String[] key) { this.key = key; } TABLE html:form action=/item/StoreKey logic:iterate name=RESULT property=iterator id=row TR THname/TH /TR TR TDbean:write name=row property=name//TD TD %-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:text name=row property=key/ /TD /TR /logic:iterate TR TD colspan=2 align=right html:submit/ /TD /TR /html:form /TABLE Harjeet Singh wrote: Hello everybody, This is newbie question. I have a form with the number of textfields on it which are known at runtime only, i.e. depend on the search result on DB. Could anyone send me sample code for this, on how to get the values from the forms (in the Formbean) as well as set vaues in it on re-populate. Help would be greatly appreciated. Thanks, Harjeet. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Sample code for handling variable number of text fields
You can just use an array. private String[] key= null; public String[] getKey() { return this.key; } public void setKey(String[] key) { this.key = key; } TABLE html:form action=/item/StoreKey logic:iterate name=RESULT property=iterator id=row TR THname/TH /TR TR TDbean:write name=row property=name//TD TD %-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:text name=row property=key/ /TD /TR /logic:iterate TR TD colspan=2 align=right html:submit/ /TD /TR /html:form /TABLE Harjeet Singh wrote: Hello everybody, This is newbie question. I have a form with the number of textfields on it which are known at runtime only, i.e. depend on the search result on DB. Could anyone send me sample code for this, on how to get the values from the forms (in the Formbean) as well as set vaues in it on re-populate. Help would be greatly appreciated. Thanks, Harjeet. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Sample code for handling variable number of text fields
Hello everybody, This is newbie question. I have a form with the number of textfields on it which are known at runtime only, i.e. depend on the search result on DB. Could anyone send me sample code for this, on how to get the values from the forms (in the Formbean) as well as set vaues in it on re-populate. Help would be greatly appreciated. Thanks, Harjeet. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]