Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
from java object to json compatibility
20/01/2012
13:51
Avatar
rascovich
milano
New Member
Members
Forum Posts: 1
Member Since:
20/01/2012
sp_UserOfflineSmall Offline

Hi all, 

this is not the first time I see some java to json serializer having this beahviour with List of object:

if there is more than one entry i've a javascript array associated with a variable, but if the list has only one element then the variable holds directly the object (could be a json, could be a string, ....).

this is the output of a 2 elements list

{"page":"1","records":"2","rows":[{"cod_cliente":"-",...},{"cod_cliente":"-",...}],"total":"1"}

and this if 1

{"page":"1","records":"1","rows":{"cod_cliente":"-",...},"total":"1"}

rows.... to be or not to be an array...

also if is not a jqGrid's problem it doesnt'work!

i simply suggest this little patch to be more solid

in the addJSONData function just after the line

if (!drows) { drows = []; }

add

if (ts.p.records == 1) {

if (! drows.length) {

var no_array_row = drows;

drows = new Array(1);

drows[0] = no_array_row;

}

}

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
76 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information