H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jun 20, 2019 #1 Hello This code I creating item programmatically: B4X: prefdialog.AddTextItem("key","title") How to programmatically initialize a default value? How to programmatically set it as mandatory or optional field? Thank you
Hello This code I creating item programmatically: B4X: prefdialog.AddTextItem("key","title") How to programmatically initialize a default value? How to programmatically set it as mandatory or optional field? Thank you
Erel B4X founder Staff member Licensed User Longtime User Jun 21, 2019 #2 HAH said: How to programmatically initialize a default value? Click to expand... Default values are always set programmatically. Read the tutorial: https://www.b4x.com/android/forum/threads/b4x-b4xpreferencesdialog-cross-platform-forms.103842/ It is explained. It is also shown in the example. HAH said: How to programmatically set it as mandatory or optional field? Click to expand... Why are you creating the template programmatically? You can get the items from PrefItems list and modify them. Upvote 0
HAH said: How to programmatically initialize a default value? Click to expand... Default values are always set programmatically. Read the tutorial: https://www.b4x.com/android/forum/threads/b4x-b4xpreferencesdialog-cross-platform-forms.103842/ It is explained. It is also shown in the example. HAH said: How to programmatically set it as mandatory or optional field? Click to expand... Why are you creating the template programmatically? You can get the items from PrefItems list and modify them.
H Hamied Abou Hulaikah Well-Known Member Licensed User Longtime User Jun 23, 2019 #3 Yes, I got it, I should call createmap and assign it to option before prefdialog.ShowDialog B4X: Options=CreateMap("key1":"value1","key2":"value2") And to set any field mandatory It is better to call LoadFromJson, it is simpler and quick Thank you @Erel Upvote 0
Yes, I got it, I should call createmap and assign it to option before prefdialog.ShowDialog B4X: Options=CreateMap("key1":"value1","key2":"value2") And to set any field mandatory It is better to call LoadFromJson, it is simpler and quick Thank you @Erel