Android Question File JSON

T201016

Active Member
Licensed User
Longtime User
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.

File JSON: (see: "type"):
    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
 

TILogistic

Expert
Licensed User
Longtime User
?

"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:
1642894491849.png
 
Upvote 1

T201016

Active Member
Licensed User
Longtime User
"type": "Text"
"type": "Multiline Text"
Thank you very much! I used the key without spaces, so far thinking that "MultilineText" is the correct key - with a SPACE!šŸ‘
 
Upvote 0
Top