Announcement

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

    ListGridField.addRecordClickHandler, Up/Down Arrow

    SmartClient Version: v9.1p_2014-08-31/Pro Deployment (built 2014-08-31)

    Hello,

    I have a RecordClickHandler on a ListGridField which performs some action. The problem is, when I use the Up and Down arrow to select records in the list, the RecordClickHandler fires and says my field is the field that was clicked, but it was not and I do not want the action to be performed in this case.

    com.smartgwt.client.widgets.grid.ListGridField.addRecordClickHandler(RecordClickHandler)

    I cannot change ListGrid setArrowKeyAction as I do want it to select the record. Is there any way in the ListGridField RecordClickHandler to know that the event is from an Up/Down arrow so I can ignore it?

    I would have expected that the RecordClickEvent.getField() would return null in this case as no field was actually clicked on.

    Thanks

    #2
    To avoid my field level RecordClickHandler from executing in this case, I am using the following check now in the onRecordClick.

    Code:
    String keyPressed = EventHandler.getKey();
    if (keyPressed != null) return;
    However, I still think it is not correct for a field level RecordClickEvent event to be fired in this case. From what I can see, it appears to fire the RecordClickEvent event for the first visible field in the list. Since fields can be re-ordered, the behaviour could change per field order simply because a field with a different RecordClickHandler was moved to the front.

    Regards

    Comment


      #3
      Keyboard generated click events always report the first field where ListGridField.ignoreKeyboardClicks is not set to false.

      Regards
      Isomorphic Software

      Comment


        #4
        Thank you!
        What is the expected behaviour if all of our fields have ListGridField.ignoreKeyboardClicks:false?
        Regards

        Comment


          #5
          Clarification....did you mean:
          "Keyboard generated click events always report the first field where ListGridField.ignoreKeyboardClicks is not set to true."

          Comment


            #6
            Yes we did - the behavior is as the name would imply: If "true" the field won't be reported as the target of keyboard generated click events.
            If all fields have this property set, the reported column number will be -1. Calling code will have to handle the fact that this doesn't map to a field, so the record-click occurred but there's "target cell".

            Regards
            Isomorphic Software

            Comment


              #7
              Again, thank you very much!

              Comment

              Working...
              X