Workflow Soluiton

 View Only
  • 1.  Fun with DateTimePicker components

    Posted Aug 27, 2010 11:01 AM
    I have three DateTimePicker components on a form to record the Start, End and Due Dates. I have them setup to default to the current datetime plus one business day for the Start and End datetime and the Due datetime defaults to the current datetime plus two business days with the time set to 5pm. The problem I'm having is if a user changes the Start Date from the default, the End date also needs to change to default to the same date as the new Start Date. Accordingly, the Due Date also needs to change to set itself to one business day after the End date. If the user changes the End Date from what it defaults to, the Start Date must also then change to display as one business day past the chosen End Date.

    Any idea how I can get those scenarios to work. I've tried with separate DateTime picker components (since they have the 'Post form on value change') and TimePicker components but it turned out to be a mess. I'd like to get this accomplished with just three DateTimePicker components but not sure how to without them having the 'Post form on value change' option.

    Thanks for any ideas!


  • 2.  RE: Fun with DateTimePicker components

    Posted Aug 30, 2010 10:48 AM

    If you just don't want to deal with the entire page refreshing, use a Dynamic Update Panel.  Any items with "Post form on value change" inside the panel will only trigger the panel's contents to be updated.  The DUP is also sometimes referred to as the Ajax panel. 

    In order to make the panel work, you must do the following:
     

    1. Drag the panel onto the form
    2. Drag all desired components on TOP of the panel.  Make sure they are fully in the panel
    3. Set the "Post form on value change" on the components that should trigger the change
    4. On the other components, use dynamic models or other revised process data to set their new values


  • 3.  RE: Fun with DateTimePicker components

    Posted Sep 01, 2010 01:04 PM
    Thanks for the reply. The only problem with trying to use the Dynamic Update Panel in Workflow 7 is that any DatePicker or DateTimePicker component placed inside will give a validation warning that states "DatePickerComponent may not work properly when placed inside an Update Panel". Also, the DatePicker components are the only ones with the "Post form on value change" option - DateTimePicker and TimePicker components don't have the option. I'd prefer to work with the DateTimePicker components because they're easier to work with since the Date and Time aren't split into two separate variables like I'd have to do with a DatePicker and TimePicker combo.


  • 4.  RE: Fun with DateTimePicker components
    Best Answer

    Posted Sep 01, 2010 01:48 PM

    Sorry about the timepicker component, apparently I've never had a need to use it within a ajax panel.  I'll try to get a enhancement request put through for the next release.    I don't have any great alternatives, but in cases where you have complex interactions like this,  I'll typically run them into a separate form where a full page refresh isn't so jarring. 

    Another alternative would be to use one datetime component, then click one of three buttons to set the desired field, do your calculations on the outbound path, and return back to the same page. 



  • 5.  RE: Fun with DateTimePicker components

    Posted Sep 01, 2010 02:08 PM
    Thanks for the suggestion scottwed. I like your idea of using the one DateTime component with buttons and setting fields with a return trip to the form! I already setup a subDialog component to handle setting the dates/times so that will work great! Thanks again for your reply and thoughtfulness!