Keyboard pops up in the DateDialog? Why?

Mark Read

Well-Known Member
Licensed User
Longtime User
I have an editbox where the keyboard is disabled, sub is below

B4X:
Sub ImuneDate_FocusChanged(HasFocus As Boolean)
   Dim b As EditText
   Dim Dd As DateDialog
   Dim datestring As String
   b=Sender
   
   'Stop keyboard from showing
   b.InputType=dlgCode.INPUT_TYPE_NONE
   
   Dim ret As String
   Dd.Year = DateTime.GetYear(DateTime.Now)
    Dd.Month = DateTime.GetMonth(DateTime.Now)    
    Dd.DayOfMonth = DateTime.GetDayOfMonth(DateTime.Now)
   If HasFocus Then 
      ret=Dd.show("Enter Date", "", "OK", "CANCEL", "", Null)

      If ret = DialogResponse.CANCEL Then
         Return
         End If
      DateTime.DateFormat = "dd.MM.yyyy"

      datestring=NumberFormat(Dd.DayOfMonth,2,0) & "." & NumberFormat(Dd.month,2,0) & "." &  Dd.Year
      b.Text=datestring
      DataHasChanged=1
      If btnSave.Visible=False Then         'Show save button
         btnSave.Visible=True
         End If
   End If
   
End Sub

Basically the sub works fine, an edittext_click event is also trapped and runs this sub (user has accidently pressed cancel).

The problem is, when the data dialog is visible and the user presses the day, month or year (not the + or - buttons), the keyboard pops up and doesn't go away till back is pressed. What can I do?

Thanks
Mark
 

Mark Read

Well-Known Member
Licensed User
Longtime User
Sorry Erel but I'm not sure what you mean.

The sub is called from a panel containing 6 labels and 6 edittext views. The point is to input a date into the edittext.

I have another sub which is called during initialisation of the app. Three questions are asked. Name? and Type? using a msgbox. The 3rd is date of birth called with datedialog. I have just tried here and the same problem.

If I click day, month or year (not + or -) and the keyboard appears, I can use the back button to remove it. On a small display, this could be quite annoying.
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Thanks for the info Erel. I will have to live with this problem.
 
Upvote 0
Top