Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How to get all dropdown values  RSS feed

 
Ranch Hand
Posts: 153
  • 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
 
author
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: 153
  • 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).
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!