• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic Drop Down Lists in Struts

 
Harrry Singh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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.
 
Joe Ess
Bartender
Posts: 9318
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at the DoubleSelect tag?
 
G.S. Chaudhary
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
anyone please.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic