T201016 Active Member Licensed User Longtime User Jan 22, 2022 #1 Hi, I am using the following .JSON file for "PreferenceDialog" and I don't really know what type I have to mention in the .JSON file to be able to distinguish correctly type "PrefDialog.TYPE_TEXT" from "PrefDialog.TYPE_MULTILINETEXT". (look at the highlighted line) I would be very grateful for help in solving this problem. [CODE lang="b4x" title="File JSON: (see: "type")" highlight="15,26"] Example: template.json { "Version": 1.1, "Theme": "Light Theme", "Items": [ ... { "title": "Email", "type": "Text", --------------------------------- If pi.ItemType = PrefDialog.TYPE_TEXT Then "key": "Email", "required": false }, { "title": "Description", "type": "Memo", --------------------------------- If pi.ItemType = PrefDialog.TYPE_MULTILINETEXT Then "key": "Description", "required": false } Dim sf As Object = PrefDialog.ShowDialog(Item, "OK", Maps.L(23,"CANCEL")) For i = 0 To PrefDialog.PrefItems.Size - 1 Private pi As B4XPrefItem = PrefDialog.PrefItems.Get(i) If pi.ItemType = PrefDialog.TYPE_TEXT Then Else If pi.ItemType = PrefDialog.TYPE_MULTILINETEXT Then end if Next[/CODE]
Hi, I am using the following .JSON file for "PreferenceDialog" and I don't really know what type I have to mention in the .JSON file to be able to distinguish correctly type "PrefDialog.TYPE_TEXT" from "PrefDialog.TYPE_MULTILINETEXT". (look at the highlighted line) I would be very grateful for help in solving this problem. [CODE lang="b4x" title="File JSON: (see: "type")" highlight="15,26"] Example: template.json { "Version": 1.1, "Theme": "Light Theme", "Items": [ ... { "title": "Email", "type": "Text", --------------------------------- If pi.ItemType = PrefDialog.TYPE_TEXT Then "key": "Email", "required": false }, { "title": "Description", "type": "Memo", --------------------------------- If pi.ItemType = PrefDialog.TYPE_MULTILINETEXT Then "key": "Description", "required": false } Dim sf As Object = PrefDialog.ShowDialog(Item, "OK", Maps.L(23,"CANCEL")) For i = 0 To PrefDialog.PrefItems.Size - 1 Private pi As B4XPrefItem = PrefDialog.PrefItems.Get(i) If pi.ItemType = PrefDialog.TYPE_TEXT Then Else If pi.ItemType = PrefDialog.TYPE_MULTILINETEXT Then end if Next[/CODE]
TILogistic Expert Licensed User Longtime User Jan 22, 2022 #2 ? "type": "Text" "type": "Multiline Text" JSON: { "Version": 1.66, "Theme": "Dark Theme", "Items": [ { "title": "text 1", "type": "Text", "key": "text", "required": false }, { "title": "text 2", "type": "Multiline Text", "key": "textmultiline", "required": false } ] } FormBuilder: Upvote 1
? "type": "Text" "type": "Multiline Text" JSON: { "Version": 1.66, "Theme": "Dark Theme", "Items": [ { "title": "text 1", "type": "Text", "key": "text", "required": false }, { "title": "text 2", "type": "Multiline Text", "key": "textmultiline", "required": false } ] } FormBuilder:
T201016 Active Member Licensed User Longtime User Jan 23, 2022 #3 "type": "Text" "type": "Multiline Text" Click to expand... Thank you very much! I used the key without spaces, so far thinking that "MultilineText" is the correct key - with a SPACE!? Upvote 0
"type": "Text" "type": "Multiline Text" Click to expand... Thank you very much! I used the key without spaces, so far thinking that "MultilineText" is the correct key - with a SPACE!?
T201016 Active Member Licensed User Longtime User Jan 23, 2022 #4 in the link below you can find my solution: See: my solution Upvote 0