Formatting a date automatically

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Formatting a date automatically

Post 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
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Formatting a date automatically

Post 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.
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Formatting a date automatically

Post 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.
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Formatting a date automatically

Post 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
User avatar
David
Profound Logic Staff Member
Posts: 690
Joined: Fri Jan 04, 2008 12:11 pm
First Name: David
Last Name: Russo
Company Name: Profound Logic Software
Contact:

Re: Formatting a date automatically

Post 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.
dieter
Experienced User
Posts: 122
Joined: Tue May 22, 2012 6:45 am
First Name: Dieter
Last Name: Schröder
Company Name: Ecclesia Holding GmbH
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Formatting a date automatically

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests