This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Populating one drop down based on the other

 
sree visu
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JSTL to populate one dropdown based on the selection of the other dropdown

Here is what i did:

In the form element tag i have a drop down named manufact that gets populated(and works correctly).But i would like to get the selected value of this dropdown and
populate the second drop down named providedfor.I have used the window.location.reload which reloads the form.But i don't understand why the <sql:param> tag does not get filled with the value of the
param.manufact ( as shown by numbering (1) and (2).Is there any mistake? Please help

The HTML form elements:


Now the JSTL sql tags



Thanks for your help in advance
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64183
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I would use an Ajax solution for this, and would never use the SQL JSTL tags.
 
sree visu
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you bear bibeault,
but i am a newbie to ajax and i am not clear in its concepts.Could you please tell me how to do it with JSTL and SQL tags.To be the minimum how would you save a particular form element after it is getting reloaded so that i can use it in my (2) as mentioned in my previous post.Sorry that i do not know ajax and it is not an issue if my form gets reloaded.Please help me to fix it...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64183
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The SQL tags are not intended for production use and I do not think you should be relying upon them.

If you want to use a pure JSP solution (rather than Ajax), that's fine (just less efficient), but you should do so by following best practices and sequestering any DB access to Java model classes.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If Ajax is one step too high and you want to do it all asynchronously, then just print all possible options out into a Javascript array variable and use Javascript to populate the dropdown.
 
sree visu
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Bauke Scholtz and Bear Bibeault for your reply
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic