Uploaded image for project: 'ZK Calendar'
  1. ZK Calendar
  2. ZKCAL-86

Tooltip event causes NPE (when hovered item no longer in view)

XMLWordPrintable

      Steps to Reproduce

      run the attached example

      • click the "prev" button
      • hover any calendar before the calendar week has changed (within 2 seconds)

      Current Result

      NPE exception at server side:

       

      java.lang.IllegalArgumentException: nulljava.lang.IllegalArgumentException: null at org.zkoss.zk.ui.impl.AbstractExecution.postEvent(AbstractExecution.java:138) at org.zkoss.zk.ui.impl.AbstractExecution.postEvent(AbstractExecution.java:133) at org.zkoss.zk.ui.event.Events.postEvent(Events.java:417) at org.zkoss.calendar.Calendars.service(Calendars.java:945) at org.zkoss.zk.ui.impl.DesktopImpl.service(DesktopImpl.java:838) at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1312)
      

       

      Expected Result

      tooltip events for items no longer in view should be ignored

      (ideally prevent sending the event, in case client side widget was detached before sending the event)

      Debug Information

       

      Workaround

      override the service method in
       

      	@Override
      	public void service(AuRequest request, boolean everError) {
      		// if (CalendarsEvent.ON_EVENT_TOOLTIP.equals(request.getCommand())) { // for 2.1.5
      		if (CalendarsEvent.ON_ITEM_TOOLTIP.equals(request.getCommand())) {
      			Event tooltipEvent = CalendarsEvent.getTooltipEvent(request);
      			if(tooltipEvent != null) {
      				Events.postEvent(tooltipEvent);
      			}
      		} else {
      			super.service(request, everError);
      		}
      	}
      

       

       

            hawk hawk
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: