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

    Destroy Hover Properly

    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:

        protected Canvas getCellHoverComponent(final Record record, final Integer rowNum, final Integer colNum) {
            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) {
    The above works assuming another hover is triggered. I've also used a 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?

    It sounds like you just want to reverse your change to setHoverAutoDestroy(false). You've said something unclear about "ends up destroying itself when the data arrives" - we don't know what this means. The hover is destroyed when the hover is dismissed, data arrival won't dismiss the hover.

    Perhaps what you mean is that your hover dismisses when data is fetched, which could happen if you've left rpcRequest.promptStyle at the default setting, which blocks interactivity for the whole screen during the request, which would indeed dismiss a hover, immediately upon issuing the request.


      Perfect! Exactly what I was looking for. DSRequest.setPromptStyle(PromptStule.CURSOR) fixed it. Much better solution, thank you.

      Maybe put a reference to that in the getCellHoverComponent() documentation.


        We have updated the docs with that reference.

        Thanks for the suggestion.

        Isomorphic Software