Page 1 of 1

Formatting a date automatically

Posted: Thu Sep 05, 2013 11:28 am
by dieter
Hello,

our users criticize that they have to fill date fields very exactly. They have to type the digits of the date and they have to type the dots to separate the date. Is there a possibility to render a date entry automatically? So the user should type "15032013' and the system automatically should render "15.03.2013". In the green screen we did this by using numeric fields and using an editmask.

Maybe there is a similar possibility in ProfoundUI? In the Visual Designer i had a look to the "Bind Value to a Program Field" dialog. When i change the field formatting property from "Date" to "Custom" a new field opens which is named "Custom JavaScript Function". I found no documentation for this field. Is this field a possibility to add an individual validation function to the widget? If this is true, what are the parameters?

Dieter

Re: Formatting a date automatically

Posted: Fri Sep 13, 2013 9:21 am
by David
This option on the binding dialog is in fact designed to do what you want. It allows you to write a custom function which will both control the formatting of the value when displayed, and also handle the validation when the user tries to submit the screen.

However, the option is currently it is not functional, due to a bug.

We're looking at correcting this.

When a fix is available, I will let you know and also provide some details on how it works.

Re: Formatting a date automatically

Posted: Fri Sep 13, 2013 6:30 pm
by David
I can confirm now that the bug is corrected for the next update to Profound UI. I have also created some documentation for this that you can see here:

http://www.profoundlogic.com/docs/displ ... +Formatter

The problem as it stands right now (in versions up to and including 4.6.4) is that the 'revert' property is not passed to the function, so it cannot determine whether it's being called for output or input. That is what we have corrected.

Re: Formatting a date automatically

Posted: Mon Sep 16, 2013 10:54 am
by dieter
Thank you for your answer. I will try to use the function. Maybe i will have more questions about this in the future.

Dieter

Re: Formatting a date automatically

Posted: Mon Sep 16, 2013 11:05 am
by David
Great. Look for the next release (it will be 4.7.0) that will include the fix for the 'revert' flag.

I'm not sure if I was very clear before, but the problem with the 'revert' flag is still there in the current release 4.6.4.

Re: Formatting a date automatically

Posted: Tue Sep 17, 2013 3:28 am
by dieter
Thank you, David.

Yes, you were clear in your post. I know, that the bug still is in version 4.6.4. The function is not urgent for me. So i think, i will test the way even if there is the bug in it.

Dieter