Android Question B4XPreferencesDialog dynamic updating

Smee

Well-Known Member
Licensed User
Longtime User
I have a simple Dialog box that I'm trying to use to get input for 3 or 4 fields

I want to be able to preload a default for each item that may change each time it's called ( I'm using a table and thought this would be more efficient than using InlineEditing)I am having trouble grasping the concept of how to fill the data just before the Dialog is called

My code that doesn't work but doesn't throw any error

B4X:
Sub prefdialog_BeforeDialogDisplayed (Template As Object)
    prefdialog.GetPrefItem("Metres").Extra.Initialize
    prefdialog.GetPrefItem("Metres").Extra.Put("Value",350)
End Sub
If I don't initialize I get an error
The Key is "Metres" and the dialog was built with FormsBuilder

The dialog displays but the field is blank. Am I on the right track? I have tried many different methods such as
B4X:
        Dim opt As List
        opt.Initialize
        opt.Add("5")
        prefdialog.SetOptions("Metres",opt)

Nothing seems to work

Any help greatly appreciated

EDIT:

Ok so I looked at the dialogs and it seems a circular argument

https://www.b4x.com/android/forum/threads/b4x-input-dialogs-with-xui-views.101197/#content

So I'm back to square one, I need to be able to enter data for several fields at the same time, Sometimes it will be one field that needs to be changed other times it may be 4 or five
 
Last edited:

teddybear

Well-Known Member
Licensed User
You may do re-LoadFromJson before it's called each time.
 
Upvote 0

Smee

Well-Known Member
Licensed User
Longtime User
You may do re-LoadFromJson before it's called each time.
Thanks for the reply

Yeah that would really entail rewriting the json in code and then calling it again

Thats a bit long winded I'm afraid
 
Upvote 0
Top