I'm trying to display a ListGrid as a hover component for a specific cell in another grid. I've overridden the getCellHoverComponent() method to achieve this and works no problem. Since the hover component is a grid, I've set setHoverAutoDestroy(false) on the hover ListGrid since it ends up destroying itself when the data arrives.
Now I'm trying to figure out how to get rid of the hover. I added a kill function at the beginning of the getCellHoverComponent() method like this:
The above works assuming another hover is triggered. I've also used a com.google.gwt.user.client.Timer to get rid of the hover after a certain amount of time. That works, but I'd like the hover to stay if the user still has their mouse over the cell.
Is there a better solution to this?
Now I'm trying to figure out how to get rid of the hover. I added a kill function at the beginning of the getCellHoverComponent() method like this:
Code:
@Override
protected Canvas getCellHoverComponent(final Record record, final Integer rowNum, final Integer colNum) {
killHardwareSetHover();
if (DSConst.OpeningSQL.HARDWARE_SET_ID.equals(getField(colNum).getName()) && record.getAttributeAsLong(DSConst.OpeningSQL.HARDWARE_SET_ID) != null) {
hardwareSetHoverGrid = new HardwareSetHardwareGrid(record.getAttributeAsLong(DSConst.OpeningSQL.HARDWARE_SET_ID));
return hardwareSetHoverGrid;
} else {
return super.getCellHoverComponent(record, rowNum, colNum);
}
}
private void killHardwareSetHover() {
if (hardwareSetHoverGrid != null) {
hardwareSetHoverGrid.destroy();
}
}
Is there a better solution to this?
Comment