Announcement

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

    ListGrid and ENTER key

    Greetings!

    I would like to use non editable ListGrid as a list for customer to select some values. Customer will use up and down arrow keys to select row and then hit ENTER key to confirm selection.
    And now my question is how to catch that ENTER key - I can not use KeyDown or KeyPressHandler, because ENTER key is not triggering handlers.
    I was hoping that method setGenerateClickOnEnter would help me, but I don't see CellClick events when I hit ENTER key.

    Is there a way to handle this?



    I'm using :
    SmartGWT 3.1p
    SmartClient Version: v8.3_2012-11-20/LGPL Development Only (built 2012-11-20)
    Chrome 26.0.1410.64 m

    #2
    See BodyKeyPressHandler for how to handle the enter key.

    Comment


      #3
      Thanks!
      Exactly what I was looking for...

      Code:
      listGrid.addBodyKeyPressHandler(new BodyKeyPressHandler() {
                  
                  @Override
                  public void onBodyKeyPress(BodyKeyPressEvent event) {
                      if (EventHandler.getKey().equalsIgnoreCase("Enter") == true) {
                          System.out.println("ENTER PRESSED !!!!" + listGrid.getSelectedRecord());
                      }
                  }
              });

      Comment

      Working...
      X