I've got a servlet with a query that builds a resultset sorted on three fields
-year-program-course-
I'd like to use the org.json classes to build up a hiearchical JSON object that, when used as a datastore for a Dojo Tree widget, makes a pretty Tree. You can see
some examples where I've hard-coded the JSON objects on this page:
It's not clear what the issue is: what is happening that shouldn't be, or vice-versa?
Stuart Rogers
Ranch Hand
Joined: Oct 02, 2008
Posts: 122
posted
0
> It's not clear what the issue is: what is happening that shouldn't be, or vice-versa?
Six hours later I'm not sure this could ever be made to work - JSONObject inherits java.util.HashMap and a consequence of this is
a JSONObject is an UNORDERED set of name-value pairs. But for the hiearchical JSON object to be usable as a Dojo datastore it
must have certain name-value pairs appear in a specific order.
So unless someone has a neat trick up their sleeve it's back to string-building -- yuck.