Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:options tag, How can I sort the options?

 
Jinesh Shah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
I am a newbie to Struts and am using htmlptions tag to display options on a web-page. Is there any way to sort the options displayed by this tag, say, by setting an attribute or something?? Please let me know.
Thanks in advance for your help!
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tag can not sort your collection. Your collection must be sorted before you come to the page.
 
Jinesh Shah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool...Thanks for you input!
 
Iftikhar Arain
Ranch Hand
Posts: 95
Flex Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AbstractList, ArrayList, LinkedList, Vector

you can sort all above list with following method.

Collections.sort(list);

Regards.
 
Jinesh Shah
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! I did it exactly the way you suggested yesterday and submitted my code
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic