Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get all dropdown values

 
Rakesh Keerthi
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i've a case where i have to get the total of all the dropdown elements. i'm able to achieve it individually. and the below is the code that worked for individual selection.



and the jsp is as below.


what i want is to get the sum of all when i select all in drop down.

Thanks
 
Esteban Herrera
author
Ranch Hand
Posts: 42
1
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe in the All option of the first page you can put something like:


and in the second page, the query can be something like:


In the case of the other options, the "IN" will have the same effect that "=". But in the case of All, the SQL will be:


If possible, avoid using String values, try to use number values as identifiers and be sure to check the request for valid values and permissions, just in case someone tries to inject invalid values or malicious code.
 
Rakesh Keerthi
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the solution Esteban . but i wanted to print them in separate rows in a table like Updates: (total), Admin Codes: (total).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic