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

dragged event in month mold disappears (when preventing update)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2.1.3
    • 2.1.2
    • None

      after dragging an event in month mold to another day and onEventUpdate event is called...

      when ignoring the event on the serverside (maybe after deciding it is forbidden to move that event to the new day) the dragged event will disappear from its previous position, and only re-appear on the next update on that day.

      @Command("updateEvent") 
      public void onUpdateEvent(@BindingParam("event") CalendarsEvent event) {
      	if(forbiddenToMove(event)) {
      		//this notification could be removed, and just return to not handle the event
      		Clients.showNotification("Not allowed to move event here", Clients.NOTIFICATION_TYPE_ERROR, null, null, 500);
      
      		//workaround for the problem: when dragging a node out of a month, it does not reappear after ghosting
      		BindUtils.postNotifyChange(null, null, this, "calendarModel");
      
      		return;
      	}
      	SimpleCalendarEvent calendarEvent = (SimpleCalendarEvent)event.getCalendarEvent();
      	calendarEvent.setBeginDate(event.getBeginDate());
      	calendarEvent.setEndDate(event.getEndDate());
      	calendarModel.update(calendarEvent);
      }
      

      workaround is currently:
      BindUtils.postNotifyChange(null, null, this, "calendarModel");

            vincentjian vincentjian
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: