• 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

Dynamic Drop Down Lists in Struts

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

I've got two drop down lists in struts. The value of second one is dependent on first one selected. Basically the first one is type of location(location Group) and the second one is a list of locations based on the type selected. I already have request variables for locations that I can use for second drop down, but the problem is how can I dynamically display locations list based on selection in first drop downlist.

I've got this in my request already



so basically how to display the second drop down based on type selected from LocationGroup Set (which is displayed in first drop down).

I know I can use Ajax, but then my request variables will not be available in AJAX methods.

Thanks in advance.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked at the DoubleSelect tag?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Add onChange=generateSecondSelectBoxValues(this.value) attribute to the Ist selectBox.
2. Perform ajax operations for that selected value
3. via Ajax fill the 2nd selectedBox

Done!! :-)

using doubleSelect component in case of dynamically large values would be hectic.
 
Harrry Singh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

G.S. Chaudhary wrote:1. Add onChange=generateSecondSelectBoxValues(this.value) attribute to the Ist selectBox.
2. Perform ajax operations for that selected value
3. via Ajax fill the 2nd selectedBox

Done!! :-)

using doubleSelect component in case of dynamically large values would be hectic.



Yes this is what I'm thinking as well, but then I will loose my request variables if I sent Ajax request.

Joe Ess wrote:Have you looked at the DoubleSelect tag?



I don't think I can use Double Select tag as I'm using struts 1.3.5 and not struts 2.
 
Harrry Singh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anyone please.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic