File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Problem with html:select and iterate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with html:select and iterate" Watch "Problem with html:select and iterate" New topic
Author

Problem with html:select and iterate

Gigi Kent
Ranch Hand

Joined: Nov 30, 2004
Posts: 40
Hello.
I have a problem and I don't know how to solve it. For about 2 day I'm working onand no results so far.
Here is:

<logic:iterate id="Item" name="iterate" >
<html:select indexed="false" name="Item" property="itemNom">
<html ptions collection="point" property="idmodule" labelProperty="module" />
</html:select>
</logic:iterate>
So I have several selects with a name someting like item[0].itemNom; item[1].itemNom etc, so every one hasa a differeny name.
So far, everything is wotking but it keeps reseting to the first option after going through the action though.
Can anyone give me an idea? Please !!!
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
I don't see how this could work unless you set indexed="true" in your html:select tag.

The next question I'd ask is: Does your ActionForm match this structure? Specifically: Do you have an indexed getter for the item attribute? You might want to show us the code for your ActionForm.


Merrill
Consultant, Sima Solutions
Gigi Kent
Ranch Hand

Joined: Nov 30, 2004
Posts: 40
Sorry.
I have iterated="true"
My ActionForm is a DynaValidatorForm.
Gigi Kent
Ranch Hand

Joined: Nov 30, 2004
Posts: 40
I don't know how to do a indexed getter. Can you give me a sample?
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
"Cornel Cc",

Welcome to JavaRanch. We don't have many rules here, but we do have a naming policy which we try to strictly enforce. Please re-read this document and edit your display name in order to comply. Thanks in advance, and we look forward to seeing you around the Ranch.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with html:select and iterate
 
Similar Threads
create select list from lag library without using struts
Problem with logic:iterate tag
Pass parameter dynamically in Javascript in html:select
Drop Down Box in Struts - Select Default Value Implementation
HTML:OPTIONS