Re: [json-lib-user] Quick Question on JSON
Brought to you by:
aalmiray
|
From: Andres A. <aal...@ya...> - 2007-12-11 20:27:18
|
Hi Haritha,=0A=0AAre you sure the contents of the named property ('JSON') a=
re not automatically converted into a JSONObject ? it looks to me like it i=
s a well formed json string, if so it should be converted automatically whe=
n you call fromObject() at top level.=0A=0ACan you please tell us which ver=
sion of Json-lib are you testing with?=0A=0ARegards,=0AAndres=0A=0A----- Or=
iginal Message ----=0AFrom: Haritha Juturu <har...@ya...>=0ATo:=
jso...@li...=0ASent: Tuesday, December 11, 2007 12:=
16:36 PM=0ASubject: [json-lib-user] Quick Question on JSON=0A=0A=0AHi Every=
one=0AI have a line of code=0AJSONObject jsonObj =3D JSONObject.fromObject(=
textField, jsonConfig ); =0Awhich produces this JSON string=0A=0A{"parent=
Id":678,"textFieldId":111,=0A"JSON":=0A"{'sizeWidth':620,'text':'=93[Winnin=
g the Nobel Peace Prize]','positionLeft':20,'style':'left:20px;top:100px;wi=
dth:620px;height:100px;','positionTop':100,'name':'','cssClass':'','objectT=
ype':'TextObject','sizeHeight':100}"=0A}=0A=0Anow if i want the property "j=
son" whose value is a string=0A =93[Winning the Nobel Peace=0APrize]','posi=
tionLeft':20,'style':'left:20px;top:100px;width:620px;height:100px;','posit=
ionTop':100,'name':'','cssClass':'','objectType':'TextObject','sizeHeight':=
100}"=0A=0Ato be converted to a json object .... is there any API methods i=
can use.i am unable to locate any.=0A=0Ai.e my output should look like =
=0A{"parentId":678,"textFieldId":111,=0A"JSON": this value is not a string =
anymore=0A{'sizeWidth':620,'text':'=93[Winning=0Athe Nobel Peace=0APrize]',=
'positionLeft':20,'style':'left:20px;top:100px;width:620px;height:100px;','=
positionTop':100,'name':'','cssClass':'','objectType':'TextObject','sizeHei=
ght':100}=0A}=0A=0AI have a constraint that i need to do this manipulation =
on the jsonObj .=0A=0AThanks=0AHaritha=0A=0A=0A=0A=0A=0A=0A Be a bette=
r friend, newshound, and =0Aknow-it-all with Yahoo! Mobile. Try it now.=0A=
=0A=0A=0A=0A=0A ______________________________________________________=
______________________________=0ABe a better friend, newshound, and =0Aknow=
-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=3DA=
hu06i62sR8HDtDypao8Wcj9tAcJ =0A |