Grid issue when using the mouse

I oppologize ahead of time for all these strange problems, but the non strange ones have all been handled so only the really strange ones are left.

Yesterday I
posted the code to my Grid
, so I won’t repost it here. The issue now is saving cells when using the mouse. When using the keyboard, everything works perfectly:

1 - Click on cell that needs editing
2 - Edit existing data
3 - Tab through additional cells in the row if necessary
4 - Press Enter, Up or Down to leave edit mode

After step #4, the Blur Listener fires, data is checked, and a save takes place if necessary. However, when I follow steps 1 through 3 then click on an editable cell in a different row, we have a problem.

The first problem is that the Blur Listener fires, but is firing on the newly selected row, not the row that blurs. This is confusing.

The second problem is that I found that The EditorListener on the Grid fires correctly, and editorMoved function fires showing me exactly which row they were on … YAY!!! However, when I query the data for that row, I get the original data instead of the data that was keyed in. On closer inspection, it seems that when using the mouse, the data entered is reverted to its original form and then the listener fires, so I have no way to know what to save.

I’m sure I am either missing something obvious here, or am doing something terribly wrong. Unfortunately, I have exhausted everything I could think of. I have explored all listeners tied to the Grid (at least that I could find), and the only two that fire when someone clicks out of one cell directly into another is the Blur Listener and this Editor Listener. Is there something I am missing here?

At this point, I assume there are quite a few bugs in the way the Grid handles its inline Edit Mode. Outside if the behavior mentioned above, we are noticing a great deal more. Here is a list of the things we have noticed so far:

  • CellStyleGenerator breaks when going into edit mode then clicking on a different row. It breaks on the row that you are leaving, not the row that you are entering. More, lets assume you have 10 rows on a page, you selected the fifth row and then you clicked on the sixth row, the fifth row will break, then the 16th row will break, then the 27th row will break, and so on until you reach the end of your list.

  • We are using the default theme where every other row in our grid is highlighted in a light grey. If we go into edit mode on a grey row, then click out, the grey row is no longer grey. Worse, when you select that row afterwards, it doesn’t highlight blue, but instead makes the font color a light shade of blue.

  • When in edit mode, there is no good way to disable edit mode programmatically. We tried using the following everywhere:

try {
    complexGrid.saveEditor();
    complexGrid.cancelEditor();
    complexGrid.focus();
} catch (FieldGroup.CommitException e) {
    e.printStackTrace();
}

… but, while this seems to close the editor on the GUI, on the back end things don’t look the same. None of our functionality that tries updating the grid fires after that code, which makes me think that something isn’t being cleaned up properly, but its hard to say for sure.

  • When in Edit Mode, tabbing through cells is a bit strange. When you get to the last cell, if you press tab again it goes into nowhere land. From there, you can’t do a great deal on the keyboard outside of pressing escape to close the edit mode. Strangely, if you press tab 10 times, you have to press Shift-Tab 10 times to return … so it is going somewhere pretty deep, just there is no visual representation where that may be.

Then there are very strange behaviors we occassionally observe, but can’t reproduce. The issues above happen all the time.

I assume that many of these are happening because the inline edit mode only appeared in this Alpha release, however I am not sure how to tell if anyone is aware of them or how to determine if they will be fixed. While our client insists on using the Grid over the Table for performance issues, due to its unstable nature I don’t think that this is possible. Does anyone have any suggestions on how we should proceed to get some of these issues resolved?