It's not a secret anymore!*
The moose likes JSP and the fly likes Qaulity Standards for Maximum no of items in SELECT tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Qaulity Standards for Maximum no of items in SELECT tag" Watch "Qaulity Standards for Maximum no of items in SELECT tag" New topic
Author

Qaulity Standards for Maximum no of items in SELECT tag

S Santosh Kumar
Ranch Hand

Joined: Mar 14, 2004
Posts: 43
Can anybody tell me what should be the maximum number of items in select t tag in JSP/HTML?
Suppose I'm giving 10,000 items, then isn't the browser will be overloaded and network utilization will be more.
Thnx in advance.


Early bird catches the worm, but remember "early worm" gets caught by bird.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

What's equally important is at what point the user overloads. Is it really useful to return that much data to the user?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
In such cases it may be better to provide the data in another way.
Maybe split it up in logical subgroups which the user is presented with first after which only the items belonging to that subgroup are shown.
Of course there may be no such division possible with your data, in which case you are basically suckered :roll:


42
S Santosh Kumar
Ranch Hand

Joined: Mar 14, 2004
Posts: 43
In my organization, We've 20,000 employees. At many places, I've to give select list for selecting employee.
Is it advisable to have SELECT fields there for such a huge data.
Should I give only staffno as entry to be made ( of course not from list) ??
Winston Smith
Ranch Hand

Joined: Jun 06, 2003
Posts: 136
I think a SELECT is certainly out of the question. I would seperate the employees into logical, manageable units (as suggested in a previous post), and display these units. For instance, you may break it down by departments, divisions, branches, etc. Whatever your company, I'm sure it has some type of organizational units. Once the user selects a department, you can display a scrollable table of employees in alphabetical order, but also provide the user with the ability to search, so they can quickly find the employee they're looking for.


for (int i = today; i < endOfTime; i++) { code(); }
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Or provide search filters that narrow down the results list.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
in your case, take several selects. For example, split them up by department (or even finer).
Search function also helps. Let users search on department, first name and/or last name and present a separate page with all matching names (paginated if needed). User clicks a name and that gets shot into the application proper.
S Santosh Kumar
Ranch Hand

Joined: Mar 14, 2004
Posts: 43
Yes, department wise logical separation is possible. However it will increase the screen size and activity from user end. But it seems this is the only way to get through. Thanks.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
I wouldn't increase screensize if you push the selection into a popup window.
Say give the user a chance to enter an employee name or number and a button. If (s)he presses the button the popup appears with your dropdowns (possibly using any entered value as search criteria).
On making a selection from the department list, the popup reloads and fills the second list with employees for that department.
On making a selection there and pressing a button, the values from the popup are stored by a piece of Javascript in the main screen (for example in that edit box and maybe a hidden field).
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I would say do a double combo script
dropdown1 - dropdown2
dropdown one contains department listings or alphabetical ranges (A-D;E-G)
you post back to the server and fill the second dropdown..you can use JavaScript to fill the second one too if you do not want to post back.
Eric
S Santosh Kumar
Ranch Hand

Joined: Mar 14, 2004
Posts: 43
Thanks Eric and Jeroen for your valuable inputs.
Santosh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Qaulity Standards for Maximum no of items in SELECT tag
 
Similar Threads
MultiActionController show form data in JSP
Struts 2 Select Tag
Max length of select statement
Populating drop-down box in JSP using bean
problem with OPTION tag