I’m having this XPage containing document data from two different datasources. Now I plan to do some calculations upon saving the Xpage.
Since designer shows me complete sets of data events for each of my data sources I expected that I could use separate codes for each datasource’s querySaveDocument.
But to my surprise both querySaveDocument events appear to be in sync all of the time: changing JS code on one datasource the code of the other is changed accordingly and immediately.
Since I didn’t find any info on that so far: is that wanted behaviour? If so: why is designer showing separate event sets then? Or am I just missing something?
Subject: RE: XPages question: only one common set of data events for multiple data sources?
Hi…
I took a look at this, it appears to be only a UI bug, in that the correct information is entered onto the XPage. It appears when you change focus from one data source to another in the Events panel, but at the same time you select an event with the same name as the previous event the Events panel does not update.
This issue has been reported to Development.
In the meantime is to select an event by a different name in the events panel as this will cause the UI to update.
Subject: Confirmed, thanks. Still one more question, though…
Sorry, didn’t look at the source code. So, as a workaround I pulled both event codes into one datasource event. Now, your answer brought up a nwe question:
are similar events executed in parallel threads or are they running in some predictable order where one would wait for the other to finish?
Example:
assume if I have 2 datasources on one XPage and there is some code in both querySaveDocument events. Now if both codes would try to change the same data set, what would happen? Is one executed after the other? If so, can we tell which one comes first?
Or would both be executed at “the same time” / in parallel threads?