iOS Question B4XDialog, B4XInputTemplate number input problem

jefflynn1974

Member
Licensed User
Longtime User
Hi,
I'm developing an application in which I need a dialog with an input field for numbers. I'm using the following code:
Input dialog:
Sub InputPINCode(message As String) As ResumableSub
    Dim xui As XUI
    Dim Dialog As B4XDialog
    Dim Input As B4XInputTemplate

    Input.Initialize
    Input.lblTitle.Text = message
    
    Dialog.Initialize(MainPage.RootPanel)
    Input.ConfigureForNumbers(False, False) 'AllowDecimals, AllowNegative

    Dialog.Title = "Enter PIN code"

    Wait For (Dialog.ShowTemplate(Input, "OK", "", "Cancel")) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        Dim res As String = Input.Text 'no need to check with IsNumber
        Log(res)
        Return res
    Else
        Return "xxxx"
    End If
End Sub
This is working fine as long as the number doesn't start with zero. As you can see in the picture, when the first digit is 0, the OK button becomes disabled. How could this be possibly fixed?
 

Attachments

  • viber_kép_2020-09-11_16-04-46.jpg
    viber_kép_2020-09-11_16-04-46.jpg
    183.6 KB · Views: 277
Top