Error getSelectedDays() method CN1 Calendar

44 views
Skip to first unread message

Mario Barón

unread,
Sep 8, 2017, 3:32:40 PM9/8/17
to CodenameOne Discussions
Hi guys,


I'm currently working with a new feature you guys put out a couple days ago which is the Multiple day Selection capability on the CN1 Calendar. on the simulator, it works perfectly and as expected, but on real devices the app throws an NoSuchMethodException for the getSelectedDays() method and the iOS version doesn't even build, generating the build log that I attach to this question. Can you please help me with this? 

Thanks in advance.
iOS Calendar build error 08-09-2017.txt

diamon...@gmail.com

unread,
Sep 8, 2017, 4:21:20 PM9/8/17
to CodenameOne Discussions
Hi,

getSelectedDays() returns a Collection, how are you calling it?

Mario Barón

unread,
Sep 8, 2017, 5:13:46 PM9/8/17
to CodenameOne Discussions
Hey Diamond, 

thanks for your quick reply. I'm basically just casting it to a list to be able to get some its items using the position (using the get(int) method), I want to keep this list in the order the user has been selecting them.


basically something like this:
Date date=new Date(((List<Date>) calendarioFecha.getSelectedDays()).get(2).getTime());

diamon...@gmail.com

unread,
Sep 8, 2017, 5:27:58 PM9/8/17
to CodenameOne Discussions
Just tried it and it builds successfully for iOS on my side. 

Try delaying that method until Calendar is fully initialized, preferably in the postShow()() of your for form.

Then update your CN1 lib and refresh.

Also, check the size of the List returned by that method in the simulator:

System.out.println(calendarioFecha.getSelectedDays().size());

Shai Almog

unread,
Sep 9, 2017, 1:40:23 AM9/9/17
to CodenameOne Discussions
This was my bad. I botched the server deployment this week and fixed it later.
New features didn't work until the fix was deployed.

Mario Barón

unread,
Sep 11, 2017, 10:38:18 AM9/11/17
to CodenameOne Discussions
Hey guys,

the iOS version of the app is working as expected nevertheless, the Android version still has the same problems I was talking about. When trying to access the screen which contains a calendar, the error shown in the attached screenshot appears.
Screenshot_2017-09-11-09-13-45.png
Screenshot_2017-09-11-09-13-38.png

Shai Almog

unread,
Sep 12, 2017, 2:12:56 AM9/12/17
to CodenameOne Discussions
Hi,
that was a tough one. It seems that our hosting provider moved one of our VPS's to a new box and when we restored it we didn't activate sync... It should work now.
You were probably just unlucky enough to hit that specific box...

Mario Barón

unread,
Sep 12, 2017, 12:36:19 PM9/12/17
to CodenameOne Discussions
Ok, I can confirm this is working as expected now. 


Thanks a lot guys!
Reply all
Reply to author
Forward
0 new messages