Announcement

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

    How to make IButton the default on enter

    Hi
    I'm using Smart GWT Pro 2.4.
    I have the following class:
    MyClass extends com.smartgwt.client.widgets.Window

    The window have the following members:
    - Label
    - Label
    - DynamicForm
    - IButton

    How do I set the IButton to be the default on enter. I doesn't get an answer from the documentation or see any threads alike.

    #2
    Any help on this one?

    Comment


      #3
      Hi guys
      This is still an issue for me.
      Please direct me here - I did try alot of things.

      Comment


        #4
        Give it keyboard focus by calling focus().

        Comment


          #5
          I understand, but in a typical UI form / web form especially, the focus is on the first field.So, the user can type and tab and type and tab.
          When he hit enter, it trigger the default button.

          I assume SmartClient does not cater for such behavior.

          Comment


            #6
            Then you are looking for DynamicForm.saveOnEnter - if you have an external IButton rather than a SubmitItem in the form, you can use a SubmitValuesHandler to call the same logic you have in your IButton's ClickHandler (the docs have all the details).

            Comment

            Working...
            X