• 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

drop down menu

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone.

I am trying to create a drop down menu using JSP. The content of the menu should be fetched from a column in the table. For example;

Table name: week
Column name: days
Days has (mon, tue, wed, thurs, fri, sat, sun)

now i want to make a drop down such that it would fetch from table week and put in the days as the content of the drop down.
Any suggestions or help will be much appreciated.

Thanks
 
Sheriff
Posts: 67746
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
What have you got so far? DO you have the HTML and JavaScript that defines the menu designed? Until you know what it is you want to build, it's not time to think about the JSP to build it.
 
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These tables, are they DB tables or html tables?
 
Anil Dubey
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The table exist in the Oracle sql server.
Also this is a small part of a complex issue.
----
onclick of a button i have a window pop up and this window should have the drop down menu.
based on the user selection of the day i am running a stored procedure.

Thanks
 
Dawn Charangat
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That looks pretty simple [or is it just me] - just some plain javascript should do the trick.

On click of the button, make sure you have an attribute "target=_blank" so that the response opens in a new window. Rest is just usual server side code... you fetch the data, and populate it in whatever UI component you need it to.
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay. So first design the HTML which is going to contain that drop-down. You know what HTML element you're going to use, right? (If not then that's the first thing to find out.) Write out an example with a couple of entries in it.

Once you have that, then you know what your JSP should be generating. But it needs some input to work from. So you should have a servlet that extracts the data required to produce the drop-down and puts it in a list of objects. Add that list to the request scope and forward to the JSP. The JSP will contain some JSTL code to produce the drop-down from that list.

That's just a general description. But hopefully you can see that there's several different parts of the design. Don't try to do them all in one lump, do them separately. It may happen that you have to redo one part of your design when you find in some other part that there's something missing, but that's normal in the design process.
 
Anil Dubey
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys..

I am going to attempt all those and let you all know how it went.

Thanks for all the suggestions
 
reply
    Bookmark Topic Watch Topic
  • New Topic