Announcement

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

    Date Chooser / Backspace Key problem

    I'm using SmartGWT 2.4 and IE 7.

    I'm having trouble with the Date widget when the Date Chooser Image button has focus.

    I have a modal dialog with a form / date widget. When the date choose image has focus, if the backspace key is pressed, the browser focus moves to the window "behind" my dialog.

    This behavior can be be reproduced on the Showcase site....

    1. Go to the SmartGWT showcase site.
    2. Select Various Controls under the Forms menu item, from the left hand side menu.
    3. Scroll down to the Date Controls.
    4. Click either the month/day/year text box.
    5. Tab until the date chooser image button has focus.
    6. Press the backspace key.

    At this point the browser url will change to http://www.smartclient.com/smartgwt/showcase/#main

    Click backspace and again and the browser will refresh to the main page of the showcase site.

    #2
    On some browsers, backspace means the same as the back button. You can correct for this by adding a beforeUnload handler - the core GWT Window API lets you do this.

    Comment


      #3
      Thanks for the reply.... a follow up question...

      - Since the dialog is modal, shouldn't the widget with focus, keep focus and not pass the backspace onto the browser?

      Comment


        #4
        No, not anymore than it should trap Ctrl-N and prevent opening a new browser tab because one tab has a modal dialog open. You're writing an application, but you're still just part of what the browser is doing.

        Another approach, by the way, is to *incorporate* forward/back navigation into your application via the History module.

        Comment


          #5
          Got it....

          We really don't want the backspace key to do anything when not actually acting as textual backspace key. I'm trying to intercept the key press event and cancel it, but am having trouble with widgets derived from FormItem.

          Key press events, for FormItem widgets, do not support a cancel method. Is there a way to cancel such events?

          Comment


            #6
            You can do it page-wide in one shot via the APIs on Page.

            Comment

            Working...
            X