File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Dependent dropdowns and Multiple select swap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Dependent dropdowns and Multiple select swap" Watch "Dependent dropdowns and Multiple select swap" New topic

Dependent dropdowns and Multiple select swap

Susan Monz

Joined: Aug 23, 2008
Posts: 27

I know dependent dropdowns have been discussed over and over again but my problem is slightly different.... I searched but i couldn't find. Someone please help me out here....
I am using Jdeveloper 10.1.2 with Struts and JSP , ADF BC. NO AJAX ( Could use it but can't afford more time than i have already used)

1.Ok dependent dropdowns - What i have currently done is onchange go to the action class and execute my child dropdown's view object by giving where caluse param as the value selected in parent dropdown. Now this was fine if I had only two dropdowns on my page. But my form has about 7 dropdowns, 6 radio buttons and lots more. Its an application form. Everytime I slect one of the dropdown it reloads which is costly plus I am executing the view object a lot...

2. Multiple Select swap - My basic requirement was to let user select multiple options from a drop down box by pressing ctrl. If i use this, how do i store these values in my entity object and then my data base( as an array? or comma seperated string?) Then i thought it would be cool to have multi select swap boxes.. Again I wrote a javascript function, not quite working yet...which will do the swaps between the two boxes but again how to store this data and now i will need two fields in the form for two diff boxes.. used in this case...right ??? Is there any demo anywhere for this.. i googled but didn't get anything in Struts...

I hope my questions are clear....
Please help
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Well on page submit you can call a function to select all of the values in the list so they are submitted to the server.


You can make a hidden textbox on the page that has a comma deliminated version of the values in your select box. When the user moves something over you recalculate the hidden's value.

Susan Monz

Joined: Aug 23, 2008
Posts: 27
Thanks for replying. Is this in reply for how to store the values?
Then in the second option, my problem is each dropdown has atleast 20 values. to write a comma seperated combination for each is going to be tough. About the first option not sure, what you mean?
I agree. Here's the link:
subject: Dependent dropdowns and Multiple select swap
It's not a secret anymore!