Skip to main content

JSON and ArrayList question

1 reply [Last post]
Joined: 2006-03-12

Did anyone know how to put a resultset arraylist into jsonObject in correct order?
Resultset have column name, label, abbreviation
When I use json.put(items,"result"), but the order was wrong.
I want to get the json result like this.
items: [
{name:"Alabama", label:"Alabama",abbreviation:"AL"},
{name:"Arizona", label:"Arizona",abbreviation:"AZ"},
{name:"Arkansas", label:"Arkansas",abbreviation:"AR"},

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-09-14

Currently the only way I have found around this is to do the sort yourself. If you need examples i will be happy to provide them.