• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic