• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How convert into struts html select clause

 
Vilas Lawande
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<select id="groupName" name="groupName" class="dropDownBlack_22text" >
<jsp:scriptlet>
java.util.List groups = (java.util.List) session.getAttribute("groups");
java.util.Iterator itr = groups.iterator();
while (itr.hasNext())
{
DemoBean group = (DemoBean) itr.next();
</jsp:scriptlet>
<option id="nameOfSelectedGroup" value="<jsp:expression>group.getName()</jsp:expression>"> <jsp:expression>group.getName()</jsp:expression></option>
<jsp:scriptlet>
}
</jsp:scriptlet>
</select>
 
Siddharth Naik
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
html select tag has all attributes you have used in the code above. Please refer to Taglib Doc.

http://struts.apache.org/1.x/struts-taglib/tlddoc/index.html

You will also find an example in this discussion:

http://www.coderanch.com/t/59022/Struts/decreasing-width-drop-down-box
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic