Android Question PreferenceDialog: how to apply input data constraints?

udg

Expert
Licensed User
Longtime User
Hi all,
unfortunately it's along time I dont' use this very powerful tool (Formbuilder+PreferenceDialog), so I'm surely missing something obvious.

My goal(s)
- limit Text field to uppercase chars only (even better, limit it to some regex expression or similar)
- having a Numeric (integer) that extends to (almost) any number of digits (e.g a credit card number); this could be solved with the above regex type
- limit Numeric Range to integers only (currently, if setting it to 20-30-1, selecting 25 it gives 25.0 as result)

Probably a distinction between the field type and the keyboard type could be of help.
But, IMHO, introducing regex will help to solve almost any situation.

BTW, I know about "IsValid" to check the output data, but my preference goes to something that helps the user to input right data in a convenient way (i.e. the proper keyboard type).

Thank you all.
 

udg

Expert
Licensed User
Longtime User
You can access the B4XFloatTextFields and change the input type.
Do you mean to use "TEXT" input only (for text, numerics..) and apply regex to the B4XFloatTextField it's based on?
 
Upvote 0

udg

Expert
Licensed User
Longtime User
I agree, thats' why a regex-based input field would be nice to set the right balance between "user freedom to input anything" and field data accuracy.
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Nothing to write home about.
Since it was a quick test, I used the IsValid way of validating fields on exit. For a better and deeper control I could switch to a CustomDialog and at least highlight when the input leads to wrong data.
As said a few times. I am a great fan of PreferenceDialog+FormBuilder since they allow you to be ready in no time, but I feel it's a tool that needs some enhancements which, understandably, are lower on any priority list we can devise.
 
Upvote 0
Top