iOS Question _FocusChanged doesnt work

Tomas Petrus

Active Member
Licensed User
Longtime User
In B4A it worked.
I use it on datefield (textfield) you click there and AnotherDatePicker is shown and keyboard hide

Just in B4i this event not even fire...

Thanks for help
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Cross platform and improved version of AnotherDatePicker: https://www.b4x.com/android/forum/threads/b4x-xui-anotherdatepicker.85160/

There is no FocusChanged event in B4i.

test.gif


BeginEdit is fired when the user clicks on the text field.
 
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
_BeginEdit work, but I need to be able do something like AnotherDatapicker1.Show like in B4A reason is:

I need to have only one textfield with datetime (with blocked user input) if the person click I want to open datapicker he select date then I open time wheel - he select time and then I change value of that text field and I have date and time togenther and in right format "30.10.2018 10:00" at least that is how it work for me in B4A in B4i I am not able to show datapicker in any other way that click on the calendar button (That in final version I wont even show)..

Am I using right component for this purposes ?
How to do it in B4i ??

thx
 
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
event works it log that it fires,

AnotherDatapicker1.Show get red and seems like that .Show doesnt exist cant even compile
 

Attachments

  • datapckershow.png
    datapckershow.png
    85.5 KB · Views: 267
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
I tryied...
OK now I can call Show from Main but

when I call this
B4X:
Public Sub Show
    Log("SHOW")
    If visible Then Return
    CloseAllDialogs
    visible = True
    dateField.Enabled = False
    DrawDays
    pnlDialog.SetLayoutAnimated(0, MainPanel.Width / 2 - pnlDialog.Width / 2, MainPanel.Height / 2 - pnlDialog.Height / 2, _
        pnlDialog.Width, pnlDialog.Height)
    pnlDialog.BringToFront
    pnlDialog.SetVisibleAnimated(200, True)
End Sub

Then it never pass line
B4X:
If visible Then Return
so datepicker is not shown

I tryed to do something like:
B4X:
Public Sub Show2
    Log("SHOW2")
    'CloseAllDialogs
    visible = True
    dateField.Enabled = False
    DrawDays
    pnlDialog.SetLayoutAnimated(0, MainPanel.Width / 2 - pnlDialog.Width / 2, MainPanel.Height / 2 - pnlDialog.Height / 2, _
        pnlDialog.Width, pnlDialog.Height)
    pnlDialog.BringToFront
    pnlDialog.SetVisibleAnimated(200, True)
End Sub

but those gave me just bunch of Target null errors, any advices ?
 
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
Even I would like to for various reasons I cannot do it publicly...
So what are my options ? upload ziped and password protected project ? and send you the password by email ?
or ?
 
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
When you click on calendar icon the datapicker is shown.
What I am trying to achieve is to open the datapicker when clicking on the text field on left side and then hide original datapicker fields
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
There is a warning that AnotherDatePicker1 is never initialized. The warning is correct. You haven't added it with the designer.

What I am trying to achieve is to open the datapicker when clicking on the text field on left side and then hide original datapicker fields
Add this sub to the class:
B4X:
Private Sub DateField_BeginEdit
   Show
End Sub
 
Upvote 0
Top