Page 3 of 3
Re: Date Widget
Posted: Mon Dec 09, 2013 11:14 am
by David
If by 'return' you meant how the date is displayed in the text box (vs. how it is returned to the RPG program, as I was originally thinking), I believe this is up to the device. It will always display the date in the device's configured date format, which can vary from user to user, and device to device. There is not a way to change that.
But, you can certainly receive the date value in RPG and format using the BIFs, in whichever way you need.
Re: Date Widget
Posted: Mon Dec 09, 2013 4:10 pm
by Paul_Ramcharitar
Sorry. Yes I meant how the date is displayed in the text box. I realised, once I set the field formatting of the text box to my desired format, that is the format the program will use. Not the one displayed in the text box. It would be nice to get my desired format displayed, which the profound ui datepicker did. I will be awaiting the fix :)
Thanks for your help so far.
Re: Date Widget
Posted: Mon Dec 09, 2013 7:03 pm
by Scott Klement
Paul,
It appears that Android does not support the click() method on div elements in the DOM, and we were using this for the pui.showCalendar() method. You could try to work around it temporarily by setting your 'onclick' (for the image that you've placed over the little calendar image) to the following:
Code: Select all
preventEvent(event);
var obj = getObj("Date1");
obj.calimg.onclick();
This seemed to work a little better for me on Android vs. pui.showCalendar(). (Though, pui.showCalendar() works everywhere else but Android, it seems.)
However, I'm having a sporadic problem with it automatically selecting a date for me rather than just opening the date picker. Can you try this and see if you have the same problem? I'm using an Android emulator, whereas you perhaps have a real device.
I'll keep working on it, but please tell me if this works for you or not?
Re: Date Widget
Posted: Tue Dec 10, 2013 8:47 am
by Paul_Ramcharitar
Hi Scott, I tried it and I'm getting this error when I click/tap on the image: "Onclick Error: preventDefault is not defined".
I tried "event.preventDefault()" instead of "preventDefault(event)", and I didn't get the error. The calender did show up on my android device, but with the same behaviour that you described, with it automatically selecting a date.
I noticed that its actually selecting the date at the point where my finger touches the image widget. For e.g. the days 29 and 30 of this month are at the bottom of the calender, near where the image is when the calendar pops up, and those days are being selected when I tap the image. I notice its working fine in the browser though.
Re: Date Widget
Posted: Tue Dec 10, 2013 10:12 am
by Scott Klement
Ah, sorry, that was a typo. I meant to type preventEvent() instead of preventDefault(), but your solution of calling event.preventDefault() should also work.
The problem you describe (the click is 'bleeding through' to the calendar, and selecting the date for you) is exactly the same problem I'm getting when I test this on the virtual android device. So, thank you for confirming that it does this for you as well. This is clearly a bug in Android. I will have to find a way to work around it.
Re: Date Widget
Posted: Tue Dec 10, 2013 11:16 am
by Paul_Ramcharitar
Ok no prob. Thanks for you help so far.
Re: Date Widget
Posted: Wed Dec 11, 2013 7:26 pm
by Scott Klement
I've found a way to work around the click "bleeding through" to the popup calendar. This fix will be included in the next release of Profound UI.
Re: Date Widget
Posted: Thu Dec 12, 2013 8:25 am
by Paul_Ramcharitar
Ok great. Thanks!