Android Question How to limit the number in Numeric Range option in B4XPreferencesDialog

Che Mohamad

Member
Licensed User
Hi,
I am following this example about the
B4XPreferencesDialog - Cross platform forms here: https://www.b4x.com/android/forum/t...esdialog-cross-platform-forms.103842/#content

In the Preferences Dialog, for the Numeric Range, I need to limit the number in the to just 1-100. How can I do that?
I try to edit the Json file "Example.json" where it has this part :
{
"options": [
"100",
"1000",
"10"
],
"title": "100 - 1000",
"type": "Numeric Range",
"key": "2",
"required": false
}
but it seems it didnt have any impact.
Thank you in advance for your help.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Tested with this code:
B4X:
    p.LoadFromJson($"
{    
    "Version": 1.66,
    "Theme": "Light Theme",
    "Items": [
        {
"options": [
"100",
"1000",
"10"
],
"title": "100 - 1000",
"type": "Numeric Range",
"key": "2",
"required": false
}
]
}
    "$)
It works fine.

Are you using B4XPreferencesDialog v1.72?

If so then please upload a small project that demonstrates the issue.
 
Upvote 0

Che Mohamad

Member
Licensed User
Hi Erel,
Thanks for your reply. Yes I'm using v1.72. Still doesnt work for me.
I still cant figure out where in the code that says minimum number =1 and maximum number=100?
Example if I want to change the range to 2 (min) to 50 (max) where do I put this in the code?

Thank you in advance for your reply.
 
Upvote 0

Che Mohamad

Member
Licensed User
Hi Erel,
Sorry my bad. I just change the parameter from
"100",
"1000",
"10"

to
"1",
"100",
"1
Now it works. Thanks.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…