Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Cliff on Feb 01, 2009 16:28
open dhtmlx forum
Data processor error (multiple updates and Cusotm updates)

Hi I have a similar problem to this
http://dhtmlx.com/docs/products/kb/index.shtml?cat=search&page=1&q=7555&ssr=yes&s=multiple%20dataprocessor

When send multiple update actions from the server(along with a few custom actions) the dataprocessor only processes the 'update' actions one by one but never gets to the custom actions

Data from the server

<data><action type='update' sid='D17' tid='D17'/><action type='update' sid='D18' tid='D18'/><action type="info" sid="id" tid="id"><info><![CDATA[[ Organisation structure saved successfully ]]]></info><divid>result</divid></action></data>


performs the first two actions, one at a time but then never gets to the custom info action.

Can you please help
Cliff

using dhtmlxSuite_2008Rel3_pro_81009
and within that the version of dhtmlxdataprocessor.js : //v.1.0 build 80512/*



the JSP
mygrid = new dhtmlXGridObject('tree');
mygrid.selMultiRows = true;
mygrid.imgURL = "/dhtmlx/dhtmlxGrid/codebase/imgs/";
mygrid.enableSmartXMLParsing(true);
mygrid.enableDragAndDrop(true);
mygrid.attachEvent("onXLE",postInitOrg);
mygrid.attachEvent("onEditCell",orgCellHandler);
mygrid.init();
mygrid.attachEvent("onBeforeContextMenu",onShowMenu);
mygrid.setSkin("modern");
mygrid.loadXML("/util/GetXML.do");
mygrid.submitAddedRows(true);
myDataProcessor = new dataProcessor("/Organisation.do");
myDataProcessor.setUpdateMode("off");
myDataProcessor.setTransactionMode("POST",true);
myDataProcessor.enableUTFencoding(true);

myDataProcessor.defineAction("info",orgInfoHandler);
myDataProcessor.defineAction("update",orgUpdateHandler);
myDataProcessor.defineAction("insert",orgInsertHandler);
myDataProcessor.defineAction("loggedOut",loggedOut);
mygrid.attachEvent("onEditCell",function(stage,id,ind){
if (stage == 1) myDataProcessor.setUpdated(id,true);
    return true; });
mygrid.attachEvent("onDragIn",orgDragIn);
mygrid.attachEvent("onDrag",orgDrag);
mygrid.attachEvent("onDrop",orgDrop);    
Answer posted by Support on Feb 02, 2009 03:52
Provided XML data and js init code are correct and must not cause any issue ( the same code works correctly in local samples )
Please check the next 
a) content type of response XML stream is text/xml ( with incorrect content type , IE will be able to locate first action tag in response and ignore any others ) 
b) the name of action is exactly the same in both XML and in defineAction command

If issue still occurs - you can try to add the attached js file in addition to original one, it will add extensive debug output. 
While there were no related fixed, latest version of dataprocessor sent by email.
Attachments (1)
Answer posted by Cliff on Feb 02, 2009 20:34
Added the dhtmlxdataprocessor_debug in and this was what came out
Log:
 row 3 marked as updated
 row 4 marked as updated
 Initiating data sending for 3
 Server url: /setup20/projectTeam/BaselineSettings.do?key=hurdles

3_gr_id=3
3_c0=3
3_c1=Hurdle%200%25frts
3_c2=0
3_c3=true
3_c4=Yes
4_gr_id=4
4_c0=4
4_c1=Hurdle%2050%25fsddsdf
4_c2=50
4_c3=true
4_c4=Yes
ids=3,4

server response received <?xml version="1.0" encoding="UTF-8"?><data><action divId='resultHrd' type='update' sid='3' tid='3'/><action divId='resultHrd' type='update' sid='4' tid='4'/><action type="info"><info><![CDATA[Your settings were saved successfully ]]></info><divid>resultHrd</divid></action></data>
Not a XML


However It seem that the once the first update has been processed the action "/setup20/projectTeam/BaselineSettings.do?key=hurdles" is called again with the second row that was changed
Also: This is with the atest version of the dataprocessor file sent via email


Answer posted by Support on Feb 03, 2009 02:16
>>Added the dhtmlxdataprocessor_debug in and this was what came out
Please be sure that you are using version of dataprocessor_debug.js  attached to above post ( it doesn't contain such message as "Not a XML" - so most probably , you are using different js file ) 
Answer posted by cliff on Feb 03, 2009 14:04
OK used the new debug as attached and get the following output
thanks
cliff
row T1 marked as updated
 row T3 marked as updated
 Initiating data sending for T1
 Server url: /setup20/projectTeam/Baseline.do?

T1_gr_id=T1
T1_gr_pid=0
T1_c0=Costsdsasdd
T1_c1=%3CDIV%20style%3D%22COLOR%3A%20%23999999%22%3EDecrease%3C%2FDIV%3E
T1_c2=2
T1_c3=%3CDIV%20title%3D%24000s%20style%3D%22COLOR%3A%20%23999999%22%20_title%3D%22true%22%3E%24000s%3C%2FDIV%3E
T1_c4=
T1_c5=
T1_c6=
T1_c7=GL%20Code
T1_c8=%3CDIV%20style%3D%22COLOR%3A%20%23999999%22%3EYes%20(2)%3C%2FDIV%3E
T1_c9=true
T1_c10=true
T1_c11=-1
T1_c12=T
T1_c13=%3CDIV%20style%3D%22COLOR%3A%20%23999999%22%3EYes%20(2)%3C%2FDIV%3E
T3_gr_id=T3
T3_gr_pid=0
T3_c0=FTEssdfsd
T3_c1=0
T3_c2=1
T3_c3=3
T3_c4=
T3_c5=
T3_c6=
T3_c7=
T3_c8=%3CDIV%20style%3D%22COLOR%3A%20%23999999%22%3EYes%20(1)%3C%2FDIV%3E
T3_c9=true
T3_c10=true
T3_c11=-1
T3_c12=T
T3_c13=%3CDIV%20style%3D%22COLOR%3A%20%23999999%22%3EYes%20(1)%3C%2FDIV%3E
ids=T1,T3

server response received <?xml version="1.0" encoding="UTF-8"?><data><action divId='resultBL' type='update' sid='T1' tid='T1'/><action type="info"><info><![CDATA[Your settings were saved successfully ]]></info><divid>resultBL</divid></action><action divId='resultBL' type='update' sid='T3' tid='T3'/><action type="info"><info><![CDATA[Your settings were saved successfully ]]></info><divid>resultBL</divid></action></data>
fallback to low level parsing
Action: update SID:T1 TID:T1
 row T1 marked as normal
 Initiating data sending for T3
 Server url: /setup20/projectTeam/Baseline.do?

T3_gr_id=T3
T3_gr_pid=0
T3_c0=FTEssdfsd
T3_c1=0
T3_c2=1
T3_c3=3
T3_c4=
T3_c5=
T3_c6=
T3_c7=
T3_c8=%3CDIV%20style%3D%22COLOR%3A%20%23999999%22%3EYes%20(1)%3C%2FDIV%3E
T3_c9=true
T3_c10=true
T3_c11=-1
T3_c12=T
T3_c13=%3CDIV%20style%3D%22COLOR%3A%20%23999999%22%3EYes%20(1)%3C%2FDIV%3E
ids=T3

server response received <?xml version="1.0" encoding="UTF-8"?><data><action divId='resultBL' type='update' sid='T3' tid='T3'/><action type="info"><info><![CDATA[Your settings were saved successfully ]]></info><divid>resultBL</divid></action></data>
fallback to low level parsing
Action: update SID:T3 TID:T3
 row T3 marked as normal
Answer posted by cliff on Feb 03, 2009 15:08
This was due too the following issue
response was set to
response.setContentType("text/html;charset=UTF-8");
and not
response.setContentType("text/xml;charset=UTF-8");