webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Date Input Control restrict past dates

  • 1.  Date Input Control restrict past dates

    Posted Thu April 16, 2009 12:45 AM

    In “Date Input” control (Date Input - Date/Time Picker), how to restrict calendar pop up from being display past dates or deactivate past dates?


    #webMethods
    #webMethods-BPMS
    #MWS-CAF-Task-Engine


  • 2.  RE: Date Input Control restrict past dates

    Posted Thu April 16, 2009 05:33 PM

    In the validation section - I would imagine formatted date range would work - there is a minimum value that would need to be populated


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 3.  RE: Date Input Control restrict past dates

    Posted Thu April 16, 2009 08:03 PM

    Thanks for the response.
    I tried it. Used formatted date range and specified minimum and maximum values, but that doesn’t disable past dates and use can still select past dates.


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 4.  RE: Date Input Control restrict past dates

    Posted Fri April 17, 2009 06:55 PM

    weird - thought i responded to this yesterday - forums were down looks like yesterday - maybe loss of data? anyways it sounds like a custom behavior of not showing past dates with a popup window - the validator is most likely meant as a loss of focus or onsubmit of the form for validation to kick in… you might have to open a service request with software ag if it is important


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 5.  RE: Date Input Control restrict past dates

    Posted Mon September 13, 2010 07:02 PM

    Hi,

    has anyone been able to do this?

    Thanks
    Bruno


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 6.  RE: Date Input Control restrict past dates

    Posted Tue October 05, 2010 02:27 AM

    This feature is probably one of the most sought after in any portal and there are several free downloadable widgets that provide features to disable dates in a popup calendar based on rules.

    Looking at the properties of Formatted Date Range Validator, one would think “Ah!, cool, now I can specify the range of dates that user will have access to in the pop up calendar”. Unfortunately, it does not disable the dates outside the range, but throws a Validation message upon submitting the form. You would say, “Well, so be it, even if it is not proactive, atleast it tells the user that date selected is out of range”.

    Now, when you look at the options to choose Min and Max Dates, the option selector is a Calendar asking you to choose a specific Date!!!
    The least one would expect from a Date function is that it is configurable for a run time value rather than a design time.

    Fortunately, you can specify a value binding expression as well for min and max values if you feel that the date picker does not allow you to provide run time values. I must be very impatient coz I tried all ( or so I think ) java date format and parsing functions, but the Validator simply refuses to accept anything.

    • Should the value be a Date type or a String type?
      What format should it be in?
      Should we specify a format or does it take the default format?

    I looked for any client side javascript functions for the pop up calendar as well, but couldn’t find any.

    Also, I noticed that the validator behaves in a way that you have to necessarily specify the Max Date as well if you choose a Min Date (using the Date picker), else it complains.

    Apologies, if I seem to be too whining, but the client simply expects that CAF provides you all the tools to minimize any coding and this is an easy feature that can be done in minutes if not in seconds.

    Well, I have reverted to using Javascripts to validate the date and display a message.

    Hopefully someone who has done this can show us that we are walking in the wrong path.

    Cheers !!!


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods


  • 7.  RE: Date Input Control restrict past dates

    Posted Tue October 05, 2010 06:04 PM

    There is definitely a bug in the Formatted Date Range Validator. It will be fixed in the next release. If you need a fix prior to 8.2, please file a Service Request referencing this thread and the internal defect ID: WMC-1561

    Thank you,
    –mark


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods


  • 8.  RE: Date Input Control restrict past dates

    Posted Tue October 05, 2010 10:05 PM

    I’m going to revise my last statement. After going back and getting some feedback from the team’s expert, I have the following information (I learned something new about Validators and Converters). I had provided a sample test app, which was reviewed and fixed. (Thanks Eric!)

    Please see the attached ‘fixed’ test app for an example of how to Formatted Date Range Validation.

    Regards,
    –mark
    ValidatorTestApp_fixed.zip (15.4 KB)


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 9.  RE: Date Input Control restrict past dates

    Posted Wed October 06, 2010 11:08 AM

    If I am understanding this correctly, this behavior is not recognized as a bug but as a normal feature.
    If so, this puts us back at the original problem:

    Is there a way to disable (runtime evaluated) values on date input control?

    Thanks,
    sergio


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 10.  RE: Date Input Control restrict past dates

    Posted Wed October 06, 2010 10:33 PM

    Now I’m getting lost :slight_smile:

    You have the ability to validate against dynamic date ranges, but that’s not what you want, correct?

    Instead, you want to limit what is presented by the date range picker? No, that isn’t a supported feature.

    Regards,
    –mark


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 11.  RE: Date Input Control restrict past dates

    Posted Mon October 11, 2010 10:57 AM

    Hi,

    Thank you for your answer. I’m sorry, maybe I was’nt clear.

    My point is that :

    1 - It is not possible to prevent user to choose (using javascript) invalid dates on a date input control

    2- It also seems not possible to even perform a validation of the user input that is based on values determined after rendering - for instance dependent on the value set by the user on another portlet control.

    To make it more objective, my real problem now is that I want to accept a date range using 2 date input controls and I want the startDate control to validate date previous to the endDate control and vice versa.

    Best regards,
    SMP


    #webMethods
    #MWS-CAF-Task-Engine
    #webMethods-BPMS


  • 12.  RE: Date Input Control restrict past dates

    Posted Mon October 11, 2010 11:40 PM

    [mark] Correct

    [mark] Not quite correct. Once the user sets the value on the other control, you can refresh the date picker and use the technique demonstrated in the previous attachment to refresh the date picker and apply your date-specific validation.

    Regards,
    –mark


    #MWS-CAF-Task-Engine
    #webMethods
    #webMethods-BPMS


  • 13.  RE: Date Input Control restrict past dates

    Posted Tue October 12, 2010 10:41 AM

    I tried to follow your suggestion with no success. I modified your demo to accept a values for the “yesterday” limit but it keeps validating against the original value.

    It seems that the Validator binding isn’t getting the updated values.

    Could you help finding out my mistake? (modified project in attach.)

    Thanks
    Sergio
    ValidatorTestApp.zip (16.1 KB)


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 14.  RE: Date Input Control restrict past dates

    Posted Tue October 12, 2010 11:57 PM

    I stand corrected (again). My suggestion doesn’t work as you’ve already found out. Currently, there isn’t a way to dynamically update the standard JSF validation controls. I think you’ll have to use custom Validators which invoke your custom java code where you can code this directly.

    Regards,
    –mark


    #MWS-CAF-Task-Engine
    #webMethods-BPMS
    #webMethods