T Tim Chapman Active Member Licensed User Longtime User Oct 25, 2024 #1 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.
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 Oct 25, 2024 #2 I guess you have to adapt the source generated to use valid variablenames... Upvote 0
T Tim Chapman Active Member Licensed User Longtime User Oct 25, 2024 #3 I have no problem doing that. My concern is that BalConverter is not making proper JSON. Is that a concern for anyone else? Upvote 0
I have no problem doing that. My concern is that BalConverter is not making proper JSON. Is that a concern for anyone else?
P PaulMeuris Well-Known Member Licensed User Oct 25, 2024 #4 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
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.
T Tim Chapman Active Member Licensed User Longtime User Oct 25, 2024 #5 I understand now. Thank you. Upvote 0