-
15 Feb 2007 6:02 AM #1
TreePanel - JSON leaf value with quotes (not boolean) issue
TreePanel - JSON leaf value with quotes (not boolean) issue
Hello all,
This must be micro bug in TreePanel but its causing issues.
I am returning a JSON data to TreeLoader to TreePanel which contains "leaf":"false" which suppose to render the tree element as "folder" but because of double quotes around "false" its not taking the value. If i remove the quotes (ie, "leaf":false) it works. I searched this forum for specific issues and no one reported this as issue. Anyone facing same issue???
I am using json.org java libraries to create the JSON object.
Thanks,
Thameem
-
15 Feb 2007 6:14 AM #2
Surely that's expected. The property is being set to a string. An if test on a non-empty string is true.
-
15 Feb 2007 6:34 AM #3
how would you interpret a true or false sentence with double quotes...?
the TreeNode's leaf attribute takes a boolean...not a string who could be interpreted as a boolean with quotes.
-
15 Feb 2007 6:56 AM #4
My question is, as per JSON notation everything should be a string...So, the json.org json library is returning that as string... I am not sure how to handle this??? or is that to be fixed in the yui-ext tree code?
-
15 Feb 2007 7:01 AM #5
really? I'm not even using that library...
Originally Posted by thameema
here's what I get for a TreeNode using python's JSON encoder:
you could hack it yourself in yui-ext...but it might take a while to find out where to do it so for now I'd hack your json library if I were you.Code:{"text": "Appartement-Condominium", "leaf": true, "id": "genres/residentiel/0101"}
-
15 Feb 2007 7:02 AM #6
@thameema:
I don't think that's valid.
To my mind "Javascript Object Notation" is javascript syntax. It's the javascript source representation of an object. So a quoted string is a quoted string. Regardless of what it contains.
{ foo: "1" }
Means that the foo property is a string, and not a number.
-
15 Feb 2007 8:00 AM #7
I was wrong. It was caused by the apache commons BeanUtils class which I use to convert a bean to a map then creating the JSONObject. So, that conversion is making everything to String eventhough i set the value as boolean in my bean. Now i hacked that part and everything works.
Thanks,
Thameem
Similar Threads
-
TreePanel and JSON TreeLoader Problem (new nodes invisible)
By sjanes71 in forum Ext 2.x: Help & DiscussionReplies: 32Last Post: 11 May 2007, 6:55 AM -
Regex Strings with Quotes
By fuzzymonk in forum Sencha CmdReplies: 0Last Post: 8 Mar 2007, 6:19 AM -
TreePanel, FireFox, using Shift or Ctrl Issue
By mikegiddens in forum Ext 1.x: BugsReplies: 1Last Post: 22 Jan 2007, 12:10 AM -
Tree folder becomes leaf
By seldon in forum Ext 1.x: Help & DiscussionReplies: 6Last Post: 6 Jan 2007, 4:38 PM -
Boolean Fields Not Working in Inline Editor Grid
By kyahne in forum Ext 1.x: BugsReplies: 2Last Post: 5 Dec 2006, 1:26 AM


Reply With Quote