Announcement

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

    Hover component won't disappear

    I have a ListGrid with a custom hover component that shows another ListGrid with related records already available on the client so no server interaction is required to show the hover ListGrid. The code is shown below. I'm not sure exactly what sequence of events causes this, but sometimes the hover component stays on the screen after moving the cursor away from the row that caused it to show. I can even close the Window that contained the ListGrid and navigate elsewhere in the app, but the HoverComponent sticks around on the screen. I am calling setHoverAutoDestroy(true) on the grid.
    Code:
    @Override
    protected Canvas getCellHoverComponent(Record record, Integer rowNum, Integer colNum) {
    	RecordList packContents = record.getAttributeAsRecordList(PACK_CONTENTS);
    	RecordList newPackContents = record.getAttributeAsRecordList(NEW_PACK_CONTENTS);
    	if (newPackContents!=null && !newPackContents.isEmpty()) 
    		return getPackGrid(newPackContents);
    	else if (packContents!=null && !packContents.isEmpty()) 
    		return getPackGrid(packContents);
    	else
    		return null;
    }
    /**
     * Returns a canvas to display as hover text for a prepack item.
     * @param packContents A RecordList of PoPackContents records to display
     * @return
     */
    private Canvas getPackGrid(RecordList packContents) {
    	ListGrid grid = new ListGrid();
    	grid.setDataSource(DataSource.get(IslandPacificDSConstants.DATASOURCE_PoPackContents));
    	grid.setData(packContents);
    	grid.setAutoFitData(Autofit.BOTH);
    	grid.setAutoFitFieldWidths(true);
    	grid.setLeaveScrollbarGap(false);
    	grid.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH);
    	return grid;
    };

    #2
    If you have a mouse event handler that is throwing an error, it could cause this (if it eg happened on a mouseMove when the cursor is leaving the grid).

    Comment


      #3
      Hi jay.l.fisher,

      I know it has been some time, but does this still happen for you? Did you get nearer to the root cause of the problem?
      I'm having the same problem, see here (#1 and #8).

      Thank you & Best regards
      Blama

      Comment

      Working...
      X