Hi, guys.
I'm trying to use the B4XDialog.ShowTemplate method to ask the user to perform an action (say, to perform a file renaming or copy). Here is the code:
Now:
The value of opt.TextField1.Text is not useful (I think is the same value of opt.Text)
Thanks in advance
I'm trying to use the B4XDialog.ShowTemplate method to ask the user to perform an action (say, to perform a file renaming or copy). Here is the code:
B4X:
Dim DLG As B4XDialog
DLG.Initialize(Activity)
Dim opt As B4XInputTemplate
opt.Initialize
opt.lblTitle.text="Rename the file ?"
opt.Text="myFile.txt"
Dim oldName As String=opt.text
Wait For (D.ShowTemplate(opt, "Rename", "Duplicate", "Cancel")) Complete (Result As Int)
Dim newName as String=opt.text
..........
Now:
- if the Result is Positive (Rename), it works correctly
- the same happens for Cancel (obviously )
- But if I want to follow the Negative program branch (to Duplicate), the opt.Text value IS NOT SET after closing the dialog. For example: in the dialog input box I will find "myFile.txt", so I correct it with "File2.txt" and press "Duplicate". The value of newName remains "myFile.txt" and not "File2.txt"
The value of opt.TextField1.Text is not useful (I think is the same value of opt.Text)
Thanks in advance