B4J Question JSON Tree Example Doesn't Like BALConverter

Tim Chapman

Active Member
Licensed User
Longtime User
I convert a layout to JSON using BalConverter. https://www.b4x.com/android/forum/t...e-layouts-files-to-json-and-vice-versa.41623/
I then put that JSON into JSON Tree Example. http://basic4ppc.com:51042/json/index.html.
Then, I put the resulting code from that into B4J and the code has errors.

These two lines in the JSON are problematic:
Dim :kids As Map = Data.Get(":kids")
Dim kids As Map = 0.Get("kids")

The code gives syntax errors for :kids and for 0 as the object name (if I am using the correct term).
I can give the layout file and JSON result, but I don't think that is necessary in this case.
If anyone wants otherwise, please let me know.
 

DonManfred

Expert
Licensed User
Longtime User
I guess you have to adapt the source generated to use valid variablenames...
 
Upvote 0

PaulMeuris

Active Member
Licensed User
The JSON generated from the BalConverter application is valid. You can check it online if you like.
The generated (generic) B4X code in the Json Tree application is not correct for the JSON from the BalConverter.
If you want to use the JSON to create views in code then you will have to adapt the code as @DonManfred suggests.
 
Upvote 0
Top