| Author |
drop down menu
|
Anil Dubey
Greenhorn
Joined: Dec 11, 2008
Posts: 4
|
|
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
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56538
|
|
|
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.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Dawn Charangat
Ranch Hand
Joined: Apr 26, 2007
Posts: 249
|
|
|
These tables, are they DB tables or html tables?
|
 |
Anil Dubey
Greenhorn
Joined: Dec 11, 2008
Posts: 4
|
|
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
Joined: Apr 26, 2007
Posts: 249
|
|
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.
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16487
|
|
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
Joined: Dec 11, 2008
Posts: 4
|
|
Thanks guys..
I am going to attempt all those and let you all know how it went.
Thanks for all the suggestions
|
 |
 |
|
|
subject: drop down menu
|
|
|