Issue 2050: issue updating source of an event
Status:  Done
Owner: ----
Closed:  Jun 2014
Reported by paro...@servoy.com, Dec 16, 2013
When event is updated (updateEvent(event)) and the event.source changed to a different source, the old source will be restored after refetch.


http://jsfiddle.net/paronne/B4qFQ/4/

in the sample test click on 'Update Event' and then click on 'refetch'
Dec 16, 2013
#1 paro...@servoy.com
found issue at function fetchEventSource (EventManager.js):

function fetchEventSource(source, fetchID) {
		_fetchEventSource(source, function(events) {
	         ..........
					for (var i=0; i<events.length; i++) {
                                                /* when fetching the source, the old source is applied on the event object, overriding the update.
                                                   if event has already a source, do not update */
						if(!events[i].source) {
							events[i].source = source;
						}
						normalizeEvent(events[i]);
					}
                 ...........
	
		});
	}
Jun 7, 2014
Project Member #2 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Reproducing
Labels: Type-Bug
Jun 11, 2014
Project Member #3 adamrs...@gmail.com
This isn't really supported.. the `source` of an event object is considered a read-only property. Also, in version 2 and above, the updateEvent call on the raw object won't work anymore... you'll need to get the event object after it has been processed... via the `clientEvents` method.

In short, I'd need to know what you are trying to achieve by switching an event's source. There's probably a better way to do whatever it is you want. Please use stackoverflow if you need help. Thanks
Status: Done