This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to display the preselected item in the html dropdown as unselected.

 
antsi klando
Ranch Hand
Posts: 46
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using struts framework which requires struts-html tags to be used for constructing the JSP.

In a form,say [product.jsp] if an item is selected from the dropdown and then submitted,the same product.jsp page gets loaded with some additional informations .The dropdown displays the selected item as highlighted as it was before submitting.How to show the same page with the item as unselected after submitting the form?

Since the struts-html tags are used,<html:select> and <htmlptionsCollection> must be used.Should the code in JSP be changed or the action classes?

Thank You..!
 
Nitin Surana
Ranch Hand
Posts: 129
Java Netbeans IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All you have to do is set the value of the select as null within the action.

For e.g.
in JSP



in MyAction.java

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic