struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject [OT] Re: Populating a drop down with dynaactionform arrayList
Date Wed, 27 Aug 2008 20:24:11 GMT
Not much to say, I reckon...

Dave

--- On Wed, 8/27/08, robasta <robertdondo@gmail.com> wrote:
> this code here will suffice! i used a CountryDatabase class
> 4 the dataaccess.
> Steps:
> 1-store data in array list
> 2.0-use iterator to move thru recs
>   2.1 as u movethru recs, display the Country Name
> 
> -->note the positioning of the <select> tag
> -------------------------------------------------------------------------------------------
> <select>
> <%
> 						try{
> 							int country;						
> 							CountryDatabase db = new CountryDatabase();
> 							ArrayList<Country> objs =
> db.getCountryByCountryName("");
> 							
> 					
> 							if (objs != null){
> 								Iterator<Country> oList = objs.iterator();
> 								
> 								while(oList.hasNext()){
> 									Country Country = oList.next();
> 									%>
> 
> 	<option>
> 		<%= Country.getCountryName() %>
> 	</option>
> 
> <%}	
> 		}
> 	}catch (Exception e){
> 			//error handling code here		
> 			}	
> 						
> %></select>


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


Mime
View raw message