Even if the results coming out of the database are sorted, throwing
them into a non-sorted Collection, like a basic HashMap, will un-sort
them. If you use a List, you just preserve the database sort order.
If you use a TreeMap, you can get the same sort order, but the TreeMap
object will go
, March 08, 2005 9:34 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: Displaying a HashMap as a select
Even if the results coming out of the database are sorted, throwing
them into a non-sorted Collection, like a basic HashMap, will un-sort
them. If you use a List, you just
Good point. I had forgotten about that class (added in JDK 1.4).
On Tue, 08 Mar 2005 11:18:50 -0500, Nidel, Mike [EMAIL PROTECTED] wrote:
Note that there's also the java.util.LinkedHashMap which will
maintain whichever order you insert the values in. This gives
--
Jeff Beal
Webmedx, Inc.
Hi all
I have a HashMap in my application context called codes that
contains a bunch of key,value pairs where the key is an Integer
representing the codeID and the value is a string representing the
codeName
I simply want to create a select box containing all the items in my
HashMap (displaying
From: David Johnson [EMAIL PROTECTED]
I simply want to create a select box containing all the items in my
HashMap (displaying the codeName but passing the codeID)
What's the easiest way to do this? Can I do this wil just a vanilla
HashMap? The examples are slightly confusing.
I agree... I can
Thanks Wendy!
My problem was the following. In order to get this select to
display, I of course needed to set up all the crap asociated with
doing such a thing... This is a list partially to get it into the
archives so I can search on it later.
So, I did the following
1. Loaded an ArrayList of
, March 07, 2005 11:33 AM
Subject: Displaying a HashMap as a select
Hi all
I have a HashMap in my application context called codes that
contains a bunch of key,value pairs where the key is an Integer
representing the codeID and the value is a string representing the
codeName
I simply want to create
From: James Mitchell [EMAIL PROTECTED]
I wouldn't use a Map, I would go with a List. Primarily for ordering.
I use java.util.TreeMap-- automatic alphabetical order for my lists of
(String) codes and descriptions.
--
Wendy Smoak
8 matches
Mail list logo