tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Sammut <sup...@rogers.com>
Subject T5 JSON Preserving Order
Date Tue, 01 Dec 2009 00:35:24 GMT

Greeting,
Is it possible to create JSON objects (JSONObject, JSONArray) where the
order of items in the list is preserved by the order they are entered?

Why does JSONOArray return a pair of key and name entries in a different
order then it was originally created?

For Example:
JSONObject response = new JSONObject();
response.put("success", true);
response.put("total", 50);
response.put("metaData", new JSONArray()...);
response.put("records", new JSONArray()...);
response.put("columns", new JSONArray()...);

The above returns a JSON formatted string:
{"total":50,"columns":[{...}],"records":[{...}],"success":true,"metaData":{...},{...},{...},{...}]}}

The order of the output is unpredictable.  Is there a way to have the
Tapestry JSON objects maintain the order of their lists (via LinkedHashMap
for example?)?

Thanks,
Marcel
-- 
View this message in context: http://old.nabble.com/T5-JSON-Preserving-Order-tp26584717p26584717.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Mime
View raw message