struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robasta <robertdo...@gmail.com>
Subject Re: Populating a drop down with dynaactionform arrayList
Date Wed, 27 Aug 2008 17:43:08 GMT

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>
-- 
View this message in context: http://www.nabble.com/Populating-a-drop-down-with-dynaactionform-arrayList-tp15839874p19185454.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


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


Mime
View raw message