• 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 reset a selected list box item after search

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you seetharaman



regards,
kishore
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic