Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Only Accepting Valid Dates in Filter Editor

    We have made it very far with our SmartGWT displays and things are going well.

    One requirement we have is to validate datetime user entries.

    We can do this for pages where our timeframe entry is done in a separate control, but our problem is we have not figured out how to do this in the Filter Editor case (either typed in or entered through the pop-up dialog.

    How can we prevent catch/prevent the user form entering nonsense (text, invalid dates, etc) into the Filter Editor for a ListGrid?

    Thank you in advance,
    Patrick
    Last edited by pkelley; 14 Jun 2012, 04:45. Reason: Title was off.

    #2
    The default control used in the FilterEditor for a datetime field is the MiniDateRangeItem and it will not allow invalid dates to end up in the criteria.

    Is something wrong with this?

    If so please be very specific about what exactly you want to happen.

    Comment


      #3
      Sorry, here is more details...

      Bring up a ListGrid with a datetime field and FilterEditor turned on.
      Enter in a valid date range so that you see data.
      Then click on the datetime field in the FilterEditor to bring up the date range selection dialog.
      Type in some nonsense entry into the "To" dialog textbox like the String "TEST".
      Click OK

      The table, that previously had data, now has no data and the Filter Editor value for the datetime box says "since TEST".


      I would hope to be able to somehow keep it from allowing the user to do this either by showing an error message or icon or something similar. We have this on our timeframe selectors that are outside of the table on a couple of our other pages.

      Thanks again,
      Patrick

      Comment


        #4
        We'll be adding some code to handle this in the near future. We'll update this thread when the fix makes it into nightly builds.

        Comment


          #5
          This is much appreciated. Thank you.

          Comment


            #6
            This change should now be present in nightly builds. Let us know if you don't see it.

            Thanks
            Isomorphic Software

            Comment


              #7
              We did some initial testing and this seems to work exactly as we needed. Thank you for the quick update.

              Comment


                #8
                I work with PKelley, and have been testing the date widget. There is one more anomaly with the (new, improved) date widget that might need addressing:

                * The From date can be set to be *after* the To date, and the dialog will close (validate).

                The result of this is a "vacuous" (empty) date range, which is essentially an empty query with no results. Mathematically or logically speaking, this is a perfect valid construction, and there are theoretical contexts where it makes sense. Practically speaking, it is difficult to imagine what the advantage of allowing this to validate is, but perhaps there is a situation where the use of such a "trick" is advantageous.

                I would wager that most users would want vacuous date ranges to be invalidated before they ever are applied as filters. How to elegantly and informatively give this error/warning is a nice little GUI design challenge. Perhaps allow a hook or setter that lets the user set the validation behavior of the date widget, with the default being "invalidate vacuous date ranges"? Your call. This is not a showstopper for us, just something we noticed in testing the (new, improved) date widget, which in general we're happy with now :).

                Thanks,
                Kevin

                Comment


                  #9
                  Thanks for the heads up. We've addressed this (3.1d branch only) via an additional validator which displays a customizable error message if the user selects a To value that is earlier than the From value.

                  Should be present in nightlies going forward

                  Comment


                    #10
                    I downloaded the nightly build on the 5th and our dates do validate as expected with your first update, but we are not getting any validation for the From > To.

                    I was wondering if there was a Showcase example with a date item in a FilterEditor so I could see this behavior. I looked around and was not able to find one.

                    Thanks for the help on this.
                    Patrick

                    Comment

                    Working...
                    X