Picker with Today Button

10 views
Skip to first unread message

shop.servic...@gmail.com

unread,
Mar 1, 2019, 4:29:59 PM3/1/19
to CodenameOne Discussions
If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans/Eclipse/IDEA NetBeans 8.2
Desktop OS Windows 10 Pro
Simulator Latest
Device Android & IOS

is there a way to get a "Today" Button/option when setType(Display.PICKER_TYPE_CALENDAR); ?

        A3AppointmentDate = new Picker();
        A3AppointmentDate.setUseLightweightPopup(true);
        A3AppointmentDate.setTactileTouch(true);
        A3AppointmentDate.setDate(inc.getDateObjectFromYYYYMMDD(ApptDate));
        A3AppointmentDate.setType(Display.PICKER_TYPE_CALENDAR);
        SimpleDateFormat formatter = new SimpleDateFormat("E MM-dd-yyyy");
        A3AppointmentDate.setFormatter(formatter);


See Pictures attached.

Regards

SwingCalendar.PNG
PickerTypeCalendar.PNG

shop.servic...@gmail.com

unread,
Mar 1, 2019, 7:05:07 PM3/1/19
to CodenameOne Discussions
Sorry, Forgot this issue.

When opening Calendar for Current Month, Widget will not accept Touch Events in the past.

So If Today is March 1st and I touch the 28th (previous day) The 1st remains highlighted.
However if we select the previous Month, all days are selectable.

Thoughts?

Shai Almog

unread,
Mar 2, 2019, 12:21:54 AM3/2/19
to CodenameOne Discussions
You can use API's like setYearRange() to determine the years that are within the selectable range.
You can override the day button creation code in Calendar to highlight a specific day. This isn't exposed in picker though.

If the picker won't accept touch events it might be a regression due to the component ownership feature. We'll need to check this.

Reply all
Reply to author
Forward
0 new messages