Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 8    Views: 115

Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
03/15/13 04:13 PM (11 years ago)

JSON Snippet Keeper Problem --No screen is connected to this?

I have an App Policies simple menu in one app and I want to make a snippet for all other apps. I cannot do it. The code from the original app in JSON is: {"itemId":"EA4F3D1D9C82E75AC958653", "itemType":"BT_screen_menuListSimple", "itemNickname":"App Policies", "navBarTitleText":"App Policies", "listBackgroundColor":"#0000FF", "listRowBackgroundColor":"#0000FF", "listTitleFontColor":"#ffffff", "backgroundColor":"#0000FF", "childItems":[{"itemId":"38603DBF9539476A1D54FE6", "itemType":"BT_menuItem", "loadScreenWithItemId":"2445CCA006A28CAE0900E1A","titleText":"Privacy" }, {"itemId":"005A5B8B2795040E3573E17", "itemType":"BT_menuItem", "loadScreenWithItemId":"362313CD104F66A357A29D5","titleText":"Copyright" }, {"itemId":"7583CD49BB2E5DC664930B4", "itemType":"BT_menuItem", "loadScreenWithItemId":"964805F2B2A9DE025F14BA4","titleText":"Terms of Service" }, {"itemId":"EA30A23609400F28D6EEF60", "itemType":"BT_menuItem", "loadScreenWithItemId":"050B133C52F4BF5C584FA62","titleText":"Anti Spam" }]}, {"itemId":"2445CCA006A28CAE0900E1A", "itemType":"BT_screen_htmlDoc", "itemNickname":"Privacy", "navBarTitleText":"Privacy", "dataURL":"http://www.bestappbuilders.com/app_policies/privacy_policy.php?app_name=Opera+Music"}, {"itemId":"362313CD104F66A357A29D5", "itemType":"BT_screen_htmlDoc", "itemNickname":"Copyright", "navBarTitleText":"Copyright", "dataURL":"http://www.bestappbuilders.com/app_policies/copyright_policy_for_apps.html"}, {"itemId":"964805F2B2A9DE025F14BA4", "itemType":"BT_screen_htmlDoc", "itemNickname":"Terms of Service", "navBarTitleText":"Terms of Service", "dataURL":"http://www.bestappbuilders.com/app_policies/terms_of_service_app.html"}, {"itemId":"050B133C52F4BF5C584FA62", "itemType":"BT_screen_htmlDoc", "itemNickname":"Anti Spam", "navBarTitleText":"Anti Spam", "dataURL":"http://www.bestappbuilders.com/app_policies/anti_spam_for_apps.php"}, When I try to copy that into the Snippet Keeper and change the screen number, it does not pass the test at the JSON Validator tool. If I copy only one part, such as here: {"itemId":"66A8D31C40BDDA3E4A6A8B2", "itemType":"BT_screen_menuListSimple", "itemNickname":"App Policies", "navBarTitleText":"App Policies", "listBackgroundColor":"#0000FF", "listRowBackgroundColor":"#0000FF", "listTitleFontColor":"#ffffff", "backgroundColor":"#0000FF", "childItems":[{"itemId":"38603DBF9539476A1D54FE6", "itemType":"BT_menuItem", "loadScreenWithItemId":"2445CCA006A28CAE0900E1A","titleText":"Privacy" }, {"itemId":"005A5B8B2795040E3573E17", "itemType":"BT_menuItem", "loadScreenWithItemId":"362313CD104F66A357A29D5","titleText":"Copyright" }, {"itemId":"7583CD49BB2E5DC664930B4", "itemType":"BT_menuItem", "loadScreenWithItemId":"964805F2B2A9DE025F14BA4","titleText":"Terms of Service" }, {"itemId":"EA30A23609400F28D6EEF60", "itemType":"BT_menuItem", "loadScreenWithItemId":"050B133C52F4BF5C584FA62","titleText":"Anti Spam" }]} the menu options appear, but when I touch the screen for the option in the menu, it says Something's not right No screen is connected to this? Please explain how this should be handled.
 
AppGuy30
Code is Art
Profile
Posts: 737
Reg: Oct 29, 2011
location unknow...
14,070
like
03/15/13 06:14 PM (11 years ago)
Simple answer, get rid of the comma at the end of your code. so it looks like this: {"itemId":"EA4F3D1D9C82E75AC958653", "itemType":"BT_screen_menuListSimple", "itemNickname":"App Policies", "navBarTitleText":"App Policies", "listBackgroundColor":"#0000FF", "listRowBackgroundColor":"#0000FF", "listTitleFontColor":"#ffffff", "backgroundColor":"#0000FF", "childItems":[{"itemId":"38603DBF9539476A1D54FE6", "itemType":"BT_menuItem", "loadScreenWithItemId":"2445CCA006A28CAE0900E1A","titleText":"Privacy" }, {"itemId":"005A5B8B2795040E3573E17", "itemType":"BT_menuItem", "loadScreenWithItemId":"362313CD104F66A357A29D5","titleText":"Copyright" }, {"itemId":"7583CD49BB2E5DC664930B4", "itemType":"BT_menuItem", "loadScreenWithItemId":"964805F2B2A9DE025F14BA4","titleText":"Terms of Service" }, {"itemId":"EA30A23609400F28D6EEF60", "itemType":"BT_menuItem", "loadScreenWithItemId":"050B133C52F4BF5C584FA62","titleText":"Anti Spam" }]}, {"itemId":"2445CCA006A28CAE0900E1A", "itemType":"BT_screen_htmlDoc", "itemNickname":"Privacy", "navBarTitleText":"Privacy", "dataURL":"http://www.bestappbuilders.com/app_policies/privacy_policy.php?app_name=Opera+Music"}, {"itemId":"362313CD104F66A357A29D5", "itemType":"BT_screen_htmlDoc", "itemNickname":"Copyright", "navBarTitleText":"Copyright", "dataURL":"http://www.bestappbuilders.com/app_policies/copyright_policy_for_apps.html"}, {"itemId":"964805F2B2A9DE025F14BA4", "itemType":"BT_screen_htmlDoc", "itemNickname":"Terms of Service", "navBarTitleText":"Terms of Service", "dataURL":"http://www.bestappbuilders.com/app_policies/terms_of_service_app.html"}, {"itemId":"050B133C52F4BF5C584FA62", "itemType":"BT_screen_htmlDoc", "itemNickname":"Anti Spam", "navBarTitleText":"Anti Spam", "dataURL":"http://www.bestappbuilders.com/app_policies/anti_spam_for_apps.php"} and paste in your item id
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/15/13 06:20 PM (11 years ago)
You'll probably have to ask Stobe, as he is the Json master. But your child items are calling for screens that probably aren't there yet. If you look at your first child item, it's calling for screen '2445CCA006A28CAE0900E1A' which is shown later in your json as a html screen called 'privacy' with a dataurl. Your config file doesn't understand that there is a screen called '2445CCA006A28CAE0900E1A', so either the screen isn't loading, or isn't there in the right way or something. If you check out stobes videos on the Json snippet keeper, he probably covers those topics. I'd check those out to see if the answer has already been covered in the concepts. It kinda looks like, a menu with four choices, and four screens. If so, you'll want to end up with 5 objects. 1 menu object, and 4 screen objects. Cheers! -- Smug
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
03/16/13 01:23 AM (11 years ago)
@App Master Here is the image of what happens when I enter the JSON code into JSONLint The JSON Validator at <a href="http://jsonlint.com/" target="_blank" rel="nofollow">http://jsonlint.com/</a>. Ihe image of the error is <a href="http://bestappbuilders.com/images/nonlint.png" target="_blank" rel="nofollow">http://bestappbuilders.com/images/nonlint.png</a> > and paste in your item id Can you further explain what do you mean by this?
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
03/16/13 01:25 AM (11 years ago)
@SmugWimp >If you check out stobes videos on the Json snippet keeper, he probably covers those topics. I have checked his videos, many times, but I need solution for my case. >It kinda looks like, a menu with four choices, and four screens. If so, you'll want to end up with 5 objects. 1 menu object, and 4 screen objects. That is exactly what I want.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
03/17/13 12:58 PM (11 years ago)
To keep things simple and tidy, I'd suggest you start by pasting your "content" screens into a snippet by themselves. Since they don't need new itemIds, all you have to do is paste them in and save them. Then they will "exist" in your new app. The complete block being pasted into the snippet should consist of several items opening and closing with a surly brace, with each item separated by a comma (but not ending, as AppMaster stated). Example: {"itemId":"2445CCA006A28CAE0900E1A", "itemType":"BT_screen_htmlDoc", "itemNickname":"Privacy", "navBarTitleText":"Privacy", "dataURL":"http://www.bestappbuilders.com/app_policies/privacy_policy.php?app_name=Opera+Music"}, {"itemId":"362313CD104F66A357A29D5", "itemType":"BT_screen_htmlDoc", "itemNickname":"Copyright", "navBarTitleText":"Copyright", "dataURL":"http://www.bestappbuilders.com/app_policies/copyright_policy_for_apps.html"}, {"itemId":"964805F2B2A9DE025F14BA4", "itemType":"BT_screen_htmlDoc", "itemNickname":"Terms of Service", "navBarTitleText":"Terms of Service", "dataURL":"http://www.bestappbuilders.com/app_policies/terms_of_service_app.html"}, {"itemId":"050B133C52F4BF5C584FA62", "itemType":"BT_screen_htmlDoc", "itemNickname":"Anti Spam", "navBarTitleText":"Anti Spam", "dataURL":"http://www.bestappbuilders.com/app_policies/anti_spam_for_apps.php"} Then I would paste in just the menu with it's childItems in another snippet, and change the itemId of the menuscreen only, to match the JSON snippet itemId. This should open with a curly brace, and end with a curly brace (but really, it ends with }]}, since you are closing the childItems also). Example: {"itemId":"CHANGETHIS", "itemType":"BT_screen_menuListSimple", "itemNickname":"App Policies", "navBarTitleText":"App Policies", "listBackgroundColor":"#0000FF", "listRowBackgroundColor":"#0000FF", "listTitleFontColor":"#ffffff", "backgroundColor":"#0000FF", "childItems":[{"itemId":"38603DBF9539476A1D54FE6", "itemType":"BT_menuItem", "loadScreenWithItemId":"2445CCA006A28CAE0900E1A","titleText":"Privacy" }, {"itemId":"005A5B8B2795040E3573E17", "itemType":"BT_menuItem", "loadScreenWithItemId":"362313CD104F66A357A29D5","titleText":"Copyright" }, {"itemId":"7583CD49BB2E5DC664930B4", "itemType":"BT_menuItem", "loadScreenWithItemId":"964805F2B2A9DE025F14BA4","titleText":"Terms of Service" }, {"itemId":"EA30A23609400F28D6EEF60", "itemType":"BT_menuItem", "loadScreenWithItemId":"050B133C52F4BF5C584FA62","titleText":"Anti Spam" }]} Only thing to do after that, is to make sure whatever screen or menu contains a link to this menu uses the snippet keeper screen as the link. Hope this helps! Let me know what happens. -Chris
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
03/17/13 05:14 PM (11 years ago)
Many thanks for this explanation, it seems it all works now!
 
Stobe
buzztouch Evangelist
Profile
Posts: 1527
Reg: Mar 04, 2011
Fredericksburg,...
24,670
like
03/17/13 05:40 PM (11 years ago)
No prob! Glad to help. @Smug: "The JSON Master"? Not the first time I've heard that name before, and I smile every time. -Chris
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/17/13 05:50 PM (11 years ago)
If it helps, I always imagine you walking around in stone palace wearing a hooded robe, with gregorian chant going on in the background... ;) Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.