0
votes

I have created a GWT DataGrid (which essentially acts like a celltable) and am getting a very strange error.

java.lang.IllegalStateException: A possible infinite loop has been detected in a Cell
Widget. This usually happens when your SelectionModel triggers a SelectionChangeEvent 
when SelectionModel.isSelected() is called, which causes the table to redraw continuously.

I have found very little information of this error while searching the net, and it does not impact the front end at all, in fact, it works perfectly. Yet it still errors in eclipse when specific scenarios occur.

How to reproduce error:

-Selecting specific filters (cannot identify why it does not consistently error for every column filter)

-selecting a cell that contains data hidden with (...) and then keying left or right keyboard arrow. CSS works so when user hovers over cell, the row height expands and all text is shown.)

what causes/ fixes the error:

The error seems to come from the line of code:

myDataTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.BOUND_TO_SELCTION);

when i comment this line out the errors no longer occur. Problem is the functionality then is not desired as the keyboard selection is separate from mouse selection and the whole "3 active state" issue exists.

About my code:

I am using:

-SingleSelectionModel

-DoubleClick DOM handler

-SelectionChangeEvent.Handler (error still shows even if this is commented out)

Updated Further information:

when I follow through in debugger it just keeps calling onSelectionChange like 5 times and then errors out. Then, like I said, if i remove the SelectionChange handler it will not hit any breakpoints in my file, but does again go to the GWT file HasDataPresenter.Class and continue to run until it eventually errors there(loop style).

Furthermore if i first select a cell that does not have the ellipsis (...) and arrow over one that does have it, i do not receive the error. It is only when i initially select a cell with the (...) and arrow out, that it will error.

1
What do you do in onSelectionChange()? And why do you need a DoubleClick handler?Andrei Volgin
both the onSelectionChange and doubleclickhandler call the same local method. This method retrieves parameters from the URL bar and row selected and will redirect to a child page using these parameters. The reason for this is some pages we want this redirect to happen on 1 click of the datagrid row, and others on two.TheJavaBeast
I also updated my question with further information, please see bottom of question.TheJavaBeast

1 Answers

0
votes

Since you are offering no code, I have to guess.

The way you are setting/hiding ellipsis triggers a table to be redrawn. This, in turn, triggers a selection event (selecting the same cell). Once a cell is selected, it triggers another table redraw, etc.