Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Filter a combobox

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure if I should have posted this in the javascript section.
I have a combo box (drop down box), whose values I get from a bean.
Next to the combo box is a text box with a link next to it which would say filter. when the user types in a value and clicks on that link,
I need to filter the values of an already populated dropdown box, and am at loss to understand, how I would/could do it.
I would be grateful if someone can guide me in this.

thanks
 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have the combo box values generated by the servlet calling the jsp. The servlet should include a mechanism in which, given a parameter, you filter the set of values accordingly to that param. The link must provide that param to the servlet firing a JSP reloading.
 
Mike Anna
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Thanks for your reply. This was the last option on my mind. This IS possible, no doubt, but I am sure there is a better way to do this.May be javascript.. may be jason.. I dont know
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I need to filter the values of an already populated dropdown box,



If you want to filter already populated values, then it can be done with Javascript, if you want to repopulate them without refresh, then I think Ajax or jquery can help.



Hope this helps
 
Sheriff
Posts: 67620
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mike Anna:
I am not sure if I should have posted this in the javascript section.

I'll move it there if that turns out to be the case. Please answer the questions I pose in the rest of this reply.

I have a combo box

No, you don't. There's no combo box control in HTML. Please read this for more information.

when the user types in a value and clicks on that link, I need to filter the values of an already populated dropdown box

Using what information? Do you need to go back to the server in order to obtain more info? Or do you have everything you need already at the client? You'll need to pony up and let us know what this "filtering" entails.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic