RE: How to interate through a collection?

2003-07-23 Thread Wendy Smoak
Rick wrote: If I have a collection of employees, an employee has a name and id (int). How can I iterate through this collection and put every employee between html:option? Use html:options (note the plural, not 'option') and feed it the collection. You don't need to do the iteration

RE: How to interate through a collection?

2003-07-23 Thread victor gusz
Thanks, Wendy: Sorry, I did not make it clear. I actually got the collection directly from database using JSP scriptlet. I just do not know how to correctly display options this way. --- Wendy Smoak [EMAIL PROTECTED] wrote: Rick wrote: If I have a collection of employees, an employee has a

RE: How to interate through a collection?

2003-07-23 Thread Cecile Mercado
()%/html:option /logic:iterate In the future, try to use html:options or html:optionsCollection with a collection of options. - Cecile -Original Message- From: victor gusz [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 2:24 PM To: Struts Users Mailing List Subject: RE: How to interate through

RE: How to interate through a collection?

2003-07-23 Thread victor gusz
Thanks, Cecile: You are absolutely right, I should use html:options. I actually used that for the other box. But this one is a dependent box, I am trying to use a JavaScript function to dynamically fill the second box. I am stuck here. I am not sure how I can get the selectedItem from the first

RE: How to interate through a collection?

2003-07-23 Thread Wendy Smoak
I am not sure how I can get the selectedItem from the first box, send it through actionServlet-action class, get results from database, then use html:options to fill the second box. I am forced to try any option I have. Can you do request.setAttribute() in the scriptlet? The html:options

RE: How to interate through a collection?

2003-07-23 Thread victor gusz
Thanks, Yes, there are 8 implicit varibales available in scriptlets. I also have a dilemma about this: I have to create a empty box when user is directed to this page. So, I use request.setAttribute(employees, employees) in action class to init a empty box. If I do this again in my scriptlet,