Announcement

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

    DateItem: issue with DateItem using TextField and pressing delete key

    Hello,

    I think there is a bug in DateItem using a TextField with a mask: when the cursor is at the end of the text. When I press the delete key, an additionnal underscore appears at the end of the mask and the Date is not parseable anymore. This happens when there is an input or not ( "17/05/2013" => "17/05/2013_" or "__/__/____" => "__/__/_____").
    From this point, I can't suppress the unnecessary undercore, so I can't get a valid input anymore.

    There is a quickstart:
    Code:
    DateItem dateItem = new DateItem();
    dateItem.setTitle("Date item test");
    dateItem.setUseTextField(true);
    dateItem.setUseMask(true);
    dateItem.setEnforceDate(true);
    dateItem.setDateFormatter(DateDisplayFormat.TOEUROPEANSHORTDATE);
    I attached some attachments to this post:
    • dateItem1.png: DateItem
    • dateItem2.png: focused DateItem (mask : __/__/____)
    • dateItem3.png: Picked date (17/05/2013)
    • dateItem4.png: After delete key pressed (17/05/2013_), does not valide / parse anymore


    I'm using SmartGWT 3.0p (March 4th 2013) / GWT 2.4.0, I experience this issue using IE9, FF 18.0.2 and Chrome 27 (both Linux and Windows). Actually, we have encountered this issue for a long time: it was already buggy with SmartGWT 2.1 / GWT 2.0.0 and older browsers.

    I hope this post is clear enough. Thank you.
    Attached Files

    #2
    This is only indirectly related to masking - the problem is actually that you have not set an inputFormat to match your formatter. You can do this system-wide via APIs on DateUtil.

    If you still have some kind of issue, please try upgrading to 4.0 or at least 3.1.

    Comment


      #3
      Thank you for your quick reply, but it didn't solve the bug.

      I tried to set an inputFormat (directly on the dateItem or using DateUtil), I still get the issue.

      You can see the same behavior on the showcase : http://www.smartclient.com/smartgwt/.../#form_masking Position the cursor at the end of the Date input mask, then press delete key. Only Date/Time fields seem to be affected.

      The bug is still there after upgrading to 4.0d.
      Last edited by ssssteffff; 29 May 2013, 00:36.

      Comment


        #4
        Ah, we see it now, you said the Delete key but we were hitting Backspace.

        This is pretty obscure, but we'll queue it up to be fixed.

        Note it is still true that your first code is incorrect (due to mismatched input format) but that's unrelated to this bug with masking and the Delete key.

        Comment

        Working...
        X