-
8 Oct 2010 5:02 AM #1
JsonConverter.decode remove first two char Json field value
JsonConverter.decode remove first two char Json field value
MyJSON String
result= MyJSON;Code:{datatable:[{admin_id:1,kuladi:'trojan',sifre:'skflgorjysjurjslskfurj',adi:'Atilla İlhan',soyadi:'KARTAL',departman_id:2,lastLoginDate:'2010-10-07 11:36:24.0'}]}
I used adi:'Atilla İlhan' field but returned illa İlhan.Code:Map<String,Object> userInfo = JsonConverter.decode(result);
Best regards
Atilla İlhan KARTAL
-
8 Oct 2010 5:13 AM #2
You cannot use JsonDecoder for this.
You need to use JsonReader, or the GWT Json api directly
-
8 Oct 2010 5:16 AM #3
Can u send me example for use JsonReader from json string
-
8 Oct 2010 5:22 AM #4
-
8 Oct 2010 6:07 AM #5
store.getAt(0); return null and Store is empty;Code:RpcProxy<String> proxy = new RpcProxy<String>() { @Override protected void load(Object loadConfig, AsyncCallback<String> callback) { SERVICE.getSampleJsonData(callback); } }; ModelType type = new ModelType(); type.setRoot("datatable"); type.addField("adi","adi"); type.addField("soyadi","soyadi"); JsonLoadResultReader<ModelData> reader = new JsonLoadResultReader<ModelData>(type); BaseListLoader<BaseListLoadResult<ModelData>> loader = new BaseListLoader<BaseListLoadResult<ModelData>>(proxy,reader); ListStore<ModelData> store = new ListStore<ModelData>(loader); loader.load(); store.getAt(0);
I dont understand JsonConverter my json string parse and return True Mapping. But only removes first two character on value.
Sample : adi is a json field. adi = "Atilla İlhan". JsonConverter map returned adi="illa İlhan".
I thinking this is a bug.
-
8 Oct 2010 6:25 AM #6
No its not a bug. Your format is wrong for JsonConverter as jsonconverter needs type informations.
-
8 Oct 2010 6:38 AM #7
Ok. All rights .
Why dont read my Json string with reader ? Where is the problem?
-
8 Oct 2010 6:45 AM #8
Is your SERVICE a remoet service?
if so, than you cannot call anything on the store directly after you called load mehtod. Loading is async. You need to wait until it fnished loading.
-
8 Oct 2010 8:02 AM #9
Yes SERVICE is a remote service and return my json string data.
ok its work. but how to handler service exception as GWT RPC on rpc proxy?Code:store.addStoreListener(new StoreListener<ModelData>(){ @Override public void storeDataChanged(StoreEvent<ModelData> se) { MessageBox.alert("aa", se.getStore().getModels().get(0).get("adi").toString(), null); } } ); loader.load();
-
8 Oct 2010 8:07 AM #10
Yes SERVICE is a remote service and return my json string data.
ok its work. but how to handler service exception as GWT RPC on rpc proxy?Code:store.addStoreListener(new StoreListener<ModelData>(){ @Override public void storeDataChanged(StoreEvent<ModelData> se) { MessageBox.alert("aa", se.getStore().getModels().get(0).get("adi").toString(), null); } } ); loader.load();
Similar Threads
-
JsonConverter does not decode JSON?
By tmcguire in forum Ext GWT: DiscussionReplies: 5Last Post: 11 Mar 2010, 7:52 AM -
[UNKNOWN][3.0.0] Ext.util.JSON.decode(string json, function reviver)
By joeutz in forum Ext 3.x: BugsReplies: 6Last Post: 17 Aug 2009, 12:49 PM -
scope used for Ext.decode (Ext.util.JSON.decode)
By conorarmstrong in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 1 Jun 2009, 12:29 PM


Reply With Quote