• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to reset a selected list box item after search

 
a kishore
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

In my JSP page, i have a select box and search button. after i select one item in select box and do search, i got results. Those results i am displaying on same JSP. But the selected item in select box remain selected. i want that item to be deselected. any suggestion please?

please let me know if i am not clear.

thank you in advance,
kishore
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try an empty value attribute in the select tag (i.e. value="")...
 
a kishore
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replying Ankit,

I tried but canot do that. Actually I could not get you exactly like where i should put that line. can you give me a sample code of lines for that.

thank you,
kishore
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a kishore wrote: But the selected item in select box remain selected. i want that item to be deselected. any suggestion please?


in struts it is a default[expected] behavior . i dont know why you want to deselect anyway set in your Action class

yourForm.setListBoxVlaue(null);//here setListBoxVlaue is your setter method [i am not sure about your setter method name]

Hope this helps
 
a kishore
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you seetharaman



regards,
kishore
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a kishore wrote:thank you seetharaman


You are welcome
 
a kishore
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i Still couldnt solve my problem.

Here im explaining once again my problem:

once i select an item in select box and search, i get some results and displaying them in same jsp page. but then the selected item in select box remains selected. if i want to search again but without this select box item then i have problem like, the select box item still selected and carrying to my action class and including in search criteria.
how to solve this? please give me one solution.

thanks in advance,
kishore
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic