struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CrackheadMillionaire <crackheadmilliona...@yahoo.com>
Subject nested object on form / html:select / pre selected value in option list
Date Thu, 28 Feb 2008 00:48:25 GMT
Hello friends - 

I feel like I must be missing something simple, but can't see it for the life of me. 

Struts 1.3.8

I have an array of objects on my form that I need to submit values against.  So, I have a
top level loop something like this:

<logic:iterate name="myFormName" propety="topLevelObject.arrayOfObjects" id="whatever"
index="counter">
    
I need to build form inputs to submit properties into objects in the array.   Thus far, the
only way I have been able to get this is by writing html and forcing in the index value, as
opposed to struts tags; i.e., 

<select name="topLevelObject.arrayOfObjects[<%=counter%>]">
     <logic:iterate name="someOtherValueSet" id="newId">
     <option><bean:write name="newId" property="someField"/>
    </logic:iterate>
</select>

However, this doens't give me the ability to have a value preselected.  

What I cannot find a way to do is incorporate my index value into a struts html:select tag;
I could then use a html:optionsCollection tag which would do the job of finding a value to
preselect nicely for me.  

Any insight is greatly appreciated!

brian


      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message