You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by kalyan namburi <nv...@gmail.com> on 2007/05/22 17:05:43 UTC

displaying options with html:optionsCollection tag

I'm using html:optionsCollection tag in my jsp to display options for
multiple dropdowns.

see my code snippet below:
<logic:iterate id="availableServiceGroups"
property="availableGroupsByService" name="adminUserProfileForm" >
        <html:select property="assignedGroupIdsByService" size="1"
styleClass="wide" >
                     <html:optionsCollection name="availableServiceGroups"
property="value" label="label"/>
        </html:select>
</logic:iterate>

where "availableGroupsByService" is a hashMap and
"assignedGroupIdsByService" is an array of type int.

The problem i'm facing is,
while i'm submitting the form it is successfully submitting. But when i try
to retrieve, all the options which i selected are not getting displayed. I
am getting blank dropdown(no option displayed but the options are present in
the dropdown).
One more thing i observed is only the first hashMap entry is having problem
with the display. While debugging i observed that one hashMap entry is
getting inserted automatically inside other hashmap entry. But i don't think
this is the problem as some other options of this kind are displaying fine.
The problem is only with the first hashMap entry which is very wierd.
Any help would be appreciated.

regards,
kalyan