You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by sma3har <sm...@yahoo.com> on 2005/11/01 04:35:28 UTC

iterate arraylist question

Hi,

I want to iterate through my arraylist of objects and
display the values using bean:write and submit them
with form.

My strut config has :

    <form-bean name="myForm"
type="org.apache.struts.validator.DynaValidatorForm">
      <form-property name="feild1"
type="java.lang.String"/>
      <form-property name="feild2"
type="java.lang.String"/>
      <form-property name="feild3"
type="java.lang.String"/>
  <form-property name="feild4"
type="java.util.ArrayList"/>
     </form-bean>

feild4 is an arraylist of javabean class mybean.
class mybean{
String new1;
String new2;
String new3;
public String getNew1() {
		return new1;
	}

	public void setNew1(String new1) {
		this.new1 = new1;
	}

	public String getNew2() {
		return new2;
	}

	public void setNew2(String new2) {
		this.new2 = new2;
	}

	public String getNew3() {
		return new3;
	}

	public void setNew3(String new3) {
		this.new3 = new3;
	}

}

so how do i iterate through the arraylist of bean
objects. I have to print the values of new1,new2, new3
and submit to form using html:hidden.
Please give me an example.



Thanks
Suchi


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: iterate arraylist question

Posted by Murray Collingwood <mu...@focus-computing.com.au>.
Hi

Checkout the documentation, it even includes an example...

http://struts.apache.org/struts-taglib/tagreference-struts-logic.html#iterate

Kind regards
mc

On 31 Oct 2005 at 19:35, sma3har wrote:

> Hi,
> 
> I want to iterate through my arraylist of objects and
> display the values using bean:write and submit them
> with form.
> 
> My strut config has :
> 
>     <form-bean name="myForm"
> type="org.apache.struts.validator.DynaValidatorForm">
>       <form-property name="feild1"
> type="java.lang.String"/>
>       <form-property name="feild2"
> type="java.lang.String"/>
>       <form-property name="feild3"
> type="java.lang.String"/>
>   <form-property name="feild4"
> type="java.util.ArrayList"/>
>      </form-bean>
> 
> feild4 is an arraylist of javabean class mybean.
> class mybean{
> String new1;
> String new2;
> String new3;
> public String getNew1() {
> 		return new1;
> 	}
> 
> 	public void setNew1(String new1) {
> 		this.new1 = new1;
> 	}
> 
> 	public String getNew2() {
> 		return new2;
> 	}
> 
> 	public void setNew2(String new2) {
> 		this.new2 = new2;
> 	}
> 
> 	public String getNew3() {
> 		return new3;
> 	}
> 
> 	public void setNew3(String new3) {
> 		this.new3 = new3;
> 	}
> 
> }
> 
> so how do i iterate through the arraylist of bean
> objects. I have to print the values of new1,new2, new3
> and submit to form using html:hidden.
> Please give me an example.
> 
> 
> 
> Thanks
> Suchi
> 
> 
> 	
> 		
> __________________________________ 
> Yahoo! Mail - PC Magazine Editors' Choice 2005 
> http://mail.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.362 / Virus Database: 267.12.6/152 - Release Date: 31/10/2005
> 



FOCUS Computing - web design
Mob: 0415 24 26 24
murray@focus-computing.com.au
http://www.focus-computing.com.au




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.12.6/152 - Release Date: 31/10/2005


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