mulitple select from drop down list

Hi have a drop down list of account codes & account description like:

<select name="acc" size=5 multiple>
<option value="0">ALL</option>
<option value="1">acct1 desc</option>
<option value="2">acct2 desc</option>
<option value="3">acct3 desc</option>
................
.............
..............
<option value="n">acctn desc</option>

so every thing work's fine like if user select's 3 accounts on the screen from DD list my bean will get 3 account codes for the query and i getting them in a array
and framing the query like account IN(1, 2, 3)
so if one account code is selected or more selected it works fine retrieves aqurate results.
But when user selects ALL i want to pass all the account codes from the DD list to the Bean like:
Bean Query should look like this
account IN (1,2,3,..............n) what ever is there in the Drop down list all codes should be passed to the Bean.
Any ideas , greatly appreciated.
thanx.
vpentaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kennethxuCommented:
there are some options that you can consider:

1. in query, the condition of "account in( everyting )" is just same as didn't specify the condition at all. so you can change you bean code to handle this situation.

2. don't include all as select option, rather put an extra "select all" checkbox right after and use javascript to select every item in the list when user check that "select all" checkbox.

3. put the how list in hidden fields and submit it together:
<input type=hidden name=allacc value="1">
<input type=hidden name=allacc value="2">
....
<input type=hidden name=allacc value="n">
then, if getParameter("acc").equals( "0" ), use getParameter( "allacc" ) instead.

4. when you populate your DD list, also store the account list(or array) in session.setAttribute() and get use session.getAttribute() to get it back if use select all.

let me know if you have futher enquires.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.