aspose file tools*
The moose likes Struts and the fly likes how to make html:optionsCollection selected inside logic:iterate ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to make html:optionsCollection selected inside logic:iterate ?" Watch "how to make html:optionsCollection selected inside logic:iterate ?" New topic
Author

how to make html:optionsCollection selected inside logic:iterate ?

Vish hari
Greenhorn

Joined: Jul 21, 2008
Posts: 20
Hi friends,


<logic:iterate id="newRequests" name="newUserRequests" scope="request">
<html:select property="role">
<html ptionsCollection label="roleName" value="roleId" name="roleList" /></html:select>
<bean:write name="newRequests" property="roleId"/></td>
</logic:iterate>

In this design, I want to make particular roleId (which get printed out using bean:write)as selected in the html:select.

Can anyone please help on this.

Thanks,
Vishnuvardhan
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
In your action class, if you set the value of role equal to roleId the row in your option list with a value of roleId should be selected automatically.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to make html:optionsCollection selected inside logic:iterate ?