Categories | Question details Back To List | ||
dataprocessor and scheduler Hi I'm trying to detect concurrency issues where two people update one record. I'm doing this with a timestamp in the database. What I want to do is send back the new timestamp value in the returned XML like this <data><action type="updated " sid="7050" tid="7050" ts="12345"></action></data> and then have access to the xml in the "onEventChanged" event. is this possible? Regards Jeremy Answer posted by Alex (support) on Oct 30, 2009 04:00 Hello, Answer posted by Jeremy on Oct 30, 2009 06:29 Hi I'm using perl at the server end. This works but does need some global data Jeremy var lastxml scheduler.locale.labels.workweek_tab = "W-Week" //load stuff scheduler.config.xml_date="%Y-%m-%dT%H:%i"; scheduler.init('scheduler_here',null,"week"); scheduler.setLoadMode("month"); //scheduler.load("events.xml"); scheduler.load("ajax/entries.cgi"); myDataProcessor = new dataProcessor("ajax/test.cgi"); //lock feed url //myDataProcessor.enableDebug(true); myDataProcessor.init(scheduler); //link dataprocessor to the scheduler myDataProcessor.defineAction("updated",function(tag){ //will need this later in after update... lastxml = tag return true; });
... scheduler.attachEvent("onEventChanged", function(event_id,event_object){ alert("changed"); event_object.ts = lastxml.getAttribute("ts"); //alert (event_object.ts) })
Answer posted by Alex (support) on Oct 30, 2009 07:01 You can set a new property of updated event directly in the update handler: dp.defineAction("update",function(node){ Answer posted on Oct 30, 2009 07:38 Hi very good. thats much clearer Thanks Jeremy |