Video Screencast Help

Custom Events for DateTime components?

Created: 25 Feb 2011 | 1 comment

I have a form with three DateTimePicker components to select a "Scheduled Start", "Scheduled End" and "Due Date", as shown below:

The Dates are all set to default to the Current Date and also have a Min Date set to the current date, so they cannot be a time in the past.

What I would like to do, when someone selects a different date for the Scheduled Start Date/Time is have the Scheduled End Date/Time and Due Date automatically change value on the form to the same Date as what was selected for the Scheduled Start Date. Then if the Scheduled End Date is changed, have the Due Date automatically change to what the Schedule End date is.

Is this possible to do with Custom Events on those controls and if so, could someone point me in direction of the scripts that would be needed?


Comments 1 CommentJump to latest comment

scottwed's picture

In an attempt to answer this question, I discovered that the Post Form on Value change option is missing on that component.  I've logged an incident in the bug tracking system to get it fixed (pending review/approval as a defect) I also noticed the Calender component is missing the same option (another incident).  The time picker component was also missing the option in current code, but that's already been identified and fixed in current dev builds. 

The Date picker component does have this option, so if you can ignore the time portion, that's the solution with the least UI confusion.

I next reviewed using Custom Events, but the DateTime Picker doesn't appear to fire them, or at least it doesn't contain onChange, and onBlur doesn't appear to fire (logged another bug).

For your immediate usage, the next best alternative would be to use the Refresh Button.  That will trigger any embedded dynamic models to recalculate.  Be sure to declare  (Initialize Data component) your DateTime variables before entering the form component, that way your logic can be consistent regardless of first time entry or a revisit to the same page.

Scott Wedekind