Android Question Help me fix the calendar error (AnotherDatePicker)

vmag

Active Member
Hello.
Help me fix the calendar error (AnotherDatePicker).
When the test is performed for the first time,
the dates are set perfectly,
but if you enter the test a second time,
the calendar page begins to live its own life.
If you use panels on the second page,
then the calendar is not visible at all
(standard example AnotherDatePicker, but on the second page)
 

Attachments

  • Calendar.rar
    499.1 KB · Views: 129

MicroDrie

Well-Known Member
Licensed User
Longtime User
but if you enter the test a second time,
the calendar page begins to live its own life.
In my B4A version 12.80 (64 bits) everything works normal (only the exit button is show on top of the calender).
 
Upvote 0

vmag

Active Member
In my B4A version 12.80 (64 bits) everything works normal (only the exit button is show on top of the calender).
View attachment 148978
Do you think this is normal?
Click Exit and the calendar will be displayed on the main page, where it is absolutely not needed...
And if you put the controls AnotherDatePicker on the panel on the second page, then when you run the Test again, you will not see the calendar at all.
This is an element AnotherDatePicker error - it only works correctly on the main page
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
Yes I see what you mean: this is causing you not to test when returning to the main page or the date picker is displayed. You must hide both the EXIT button while displaying the date picker.
 
Upvote 0

vmag

Active Member
the exit button is a special case for example,
in fact, there may be about 10-30 controls on the page,
do you suggest making them all invisible so that they do not hang in front of the calendar?
Then why does everything work as it should for the first time without any dancing with a tambourine?
 
Upvote 0

vmag

Active Member
I wanted to try to hide the Exit button, but the control AnotherDatePicker has only one event - Closed and it is not clear how to hide this Exit button when selecting a date, and when opening the page, you can not immediately hide the Exit button, because you may not need to change the date
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
After enjoying a wonderful Christmas dinner, I have made the following adjustments to your program, which means that controls on a panel are made invisible during the display of the datepicker.

  1. Added a panel1 to Page2.bal
  2. Placed the panel1 behind the controls (Button1) o
  3. The controls (Button1) parent ofActivity in Panel1 changes
  4. Page2.ball saved
  5. Added Panel1 as 'Public Panel1 As Panel' on B4XPage2
I then 'quick and dirty' turned the display of Panel1 in B4XPage2 hardcoded off and on. Not a universal solution (you need to have a routine that would pass the page "B4XPage2" and the panel "Panel1" to AnotherDatePicker) for those cases where you need multiple occurrences of date picker on different B4XPages.

Edit: P.S. I've commented out all my adjustments marked '---
 

Attachments

  • datepicker.bal
    8.3 KB · Views: 110
  • AnotherDatePicker.bas
    9.5 KB · Views: 107
Upvote 0

vmag

Active Member
Hello. Thank you for your hard work. Unfortunately, I can't test this on the working layout due to its translation to Dialog + DateTemplate.
This path turned out to be both simpler and more reliable.
Here is the link, user (Maxapec)
 
Upvote 0

vmag

Active Member
I stopped at this decision.
Thank you all.
 

Attachments

  • Calendar.rar
    4.9 KB · Views: 136
  • lib_Calendar.jpg
    39.4 KB · Views: 99
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…