• 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

Populating one drop-down with DB values on the basis of the selection of another.

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have one JSP containing around 27-28 form elements on it. They include 2 drop-down boxes also. I have a requirement to populate one of those boxes with database values on the basis of the selection made in the other box.
Sounds fine as yet.
But to do that I do not want to submit the whole form as loading it takes a lot of time.
So, is there any way i can isolate these two drop-down boxes and submit only those values and the loading of the complete JSP is avoided. I thought about IFRAME. But am not able to figure out how to do that.

Can anyone help in this issue?

Regards,
Shailesh.
 
Sheriff
Posts: 67747
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
"ShaileshTheCoder Deshpande",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Bear Bibeault
Sheriff
Posts: 67747
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
This is a very common question. These days the most favored approach is to use Ajax to retrieve the secondary dropdown's values. Please search the HTML/Javascript forum for previous discussions on this topic.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suggest you try http://ajaxtags.sourceforge.net/. I found it easy to integrate with existing apps. They also have some demo pages.
 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am having a problem on the same topic and isn't there a way to do this without using ajax? because i don't know how to and it might take too long for me to learn it.

isn't there another way?

thanks
 
Bear Bibeault
Sheriff
Posts: 67747
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
Sure. Submit the page and redraw it with the new values.
 
Bernard Sigmund Gustav
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but i have 3 combo boxes on the same page all dependent on each other. would i have to submit 3 times?
 
Shailesh Deshpande
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help!
Using AJAX will be time consuming as it will involve learning curve for me. I can't afford that at present. So, I have proceeded with the loading of the whole JSP.
Will try to do it with AJAX as well.

Thanks,
Shailesh.
 
Bernard Sigmund Gustav
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this ajax thing is giving me a headache.
where do i download the ajaxtags.tld?
it's not in the beta zip file i downloaded
[ February 27, 2006: Message edited by: shuini gustav ]
 
Bear Bibeault
Sheriff
Posts: 67747
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 shuini gustav:

where do i download the ajaxtags.tld?
it's not in the beta zip file i downloaded



Yes, it is.

As per usual, it's in the META-INF folder of the jar file.

But... I'd avoid the use of a tag set for a technology you don't understand. Ajax is really a very simple technology to grasp, especially if you are used to Java-like APIs.

This might be a good place to start...
[ February 27, 2006: Message edited by: Bear Bibeault ]
 
Bernard Sigmund Gustav
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I downloaded ajaxtags-1.2-beta1.war ,the demo war file, from sourceforge.net and placed it under tomcat/webapps and then deployed it

when i run http://localhost:8080/ajaxtags-1.2-beta1/index.jsp, nothing displays. there are no errors but the page is blank. do i need to do anything else? from what i understand, it's already supposed to run
 
Bear Bibeault
Sheriff
Posts: 67747
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
You'd have to check the docs for the tag lib... I've never used them.

Since this getting off topic from the original question, I'm going to ask that if you want to post questions on using the tag lib, that you post a new topic in the "Other Open Source Projects" foum.
[ February 27, 2006: Message edited by: Bear Bibeault ]
 
Climb the rope! CLIMB THE ROPE! You too tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic