DataProcessor doesn´t work correctly after update to 3.0

Hello,

After update to DHTMLX 3.0 I´ve got a problem to update data in my database. In Version 2.6 all works fine. This is my code:

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<title id='title'>BESI Marine Systems GmbH & Co. KG - Auftragsbestandsliste</title>
		<link rel="stylesheet" type="text/css" href="../../dhtmlx/dhtmlx.css" />
		<script type="text/javascript" src="../../dhtmlx/dhtmlx.js"></script>
		<script src="../../dhtmlx/connector/dataprocessor.js"></script>
		<script src="../../dhtmlx/connector/connector.js"></script>
		<script>
			function buildInterface(){
				dhxWins = new dhtmlXWindows();
				
				// Layout
				ablLayout = new dhtmlXLayoutObject(document.body, "1C");
				ablLayout.cells("a").setText("Auftragsbestandsliste");
		
				// Grid Master
				ablGridMaster = ablLayout.cells("a").attachGrid();
				ablGridMaster.setImagePath("../../dhtmlx/imgs/");
				ablGridMaster.setHeader("Kommission,NeubauNr,Kunde,Liefertermin,KW,Auftragsart,Bestellung,Beschreibung");
				ablGridMaster.attachHeader("#text_filter,#text_filter,#select_filter,#text_filter,#select_filter,#select_filter,&nbsp;,,&nbsp;");
				ablGridMaster.setInitWidths("75,120,150,80,90,150,*,*");
				ablGridMaster.setColAlign("right,left,left,right,right,left,left,left");
				ablGridMaster.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro");
				ablGridMaster.setColSorting("int,str,str,date,str,str,str,str");
				ablGridMaster.enableMultiline(true);
				ablGridMaster.init();
				ablGridMaster.loadXML("xml/master.xml");
				ablGridMaster.attachEvent("onRowDblClicked", function (rID){
					// Detailswindow
					if(!dhxWins.window("ablDetailsWin")){
						win = dhxWins.createWindow("ablDetailsWin",20,20,500,800);
						win.center();
						win.attachEvent("onClose",function(){
							ablAccordion.cells("a3").detachToolbar();
							ablAccordion.cells("a4").detachToolbar();
							ablAccordion.cells("a5").detachToolbar();
							win.hide;
							return true;
						});
					}
					else
						win.show("ablDetailsWin");
						dhxWins.window("ablDetailsWin").setText("Auftrag "+rID);

					// Accordion 
					ablAccordion = win.attachAccordion(rID);
					ablAccordion.addItem("a1", "Auftrag");
					ablAccordion.addItem("a2", "Vertrieb");
					ablAccordion.addItem("a3", "Vertriebsabwicklung");
					ablAccordion.addItem("a4", "m. Konstruktion");
					ablAccordion.addItem("a5", "e. Konstruktion");
					ablAccordion.openItem("a1");
					
					// Toolbar Tab Vertriebsabwicklung
					vertriebsabwicklungToolbar = ablAccordion.cells("a3").attachToolbar();
					vertriebsabwicklungToolbar.setIconsPath("icons/");
					vertriebsabwicklungToolbar.loadXML("xml/vertriebsabwicklungToolbar.xml");
					vertriebsabwicklungToolbar.attachEvent("onclick",function(id){
						if(id=="saveVertriebsabwicklung"){
							dpfs_vertriebsabwicklung.sendData();
						}
					});
					
					// Toolbar Tab m. Konstruktion
					mkonstruktionToolbar = ablAccordion.cells("a4").attachToolbar();
					mkonstruktionToolbar.setIconsPath("icons/");
					mkonstruktionToolbar.loadXML("xml/mkonstruktionToolbar.xml");
					mkonstruktionToolbar.attachEvent("onclick",function(id){
						if(id=="savemKonstruktion"){
							dpfs_mkonstruktion.sendData();
						}
					});
					
					// Toolbar Tab e. Konstruktion
					ekonstruktionToolbar = ablAccordion.cells("a5").attachToolbar();

					// Form Auftrag
					auftragForm = ablAccordion.cells("a1").attachForm();
					auftragForm.loadStruct("xml/auftragForm.xml");
					auftragForm.load("xml/auftragDetails.php?id="+rID);
			
					// Form Vertrieb
					vertriebForm = ablAccordion.cells("a2").attachForm();
					vertriebForm.loadStruct("xml/vertriebForm.xml");
					vertriebForm.load("xml/vertriebDetails.php?id="+rID);
				
					// Form Vertriebsabwicklung
					vertriebsabwicklungForm = ablAccordion.cells("a3").attachForm();
					vertriebsabwicklungForm.loadStruct("xml/vertriebsabwicklungForm.xml");
					vertriebsabwicklungForm.load("xml/vertriebsabwicklungDetails.php?id="+rID);
					
					// Form m. Konstruktion
					mkonstruktionForm = ablAccordion.cells("a4").attachForm();
					mkonstruktionForm.loadStruct("xml/mkonstruktionForm.xml");
					mkonstruktionForm.load("xml/mkonstruktionDetails.php?id="+rID);
					
					// Form e. Konstruktion
					ekonstruktionForm = ablAccordion.cells("a5").attachForm();

					// DataProcessor Form Auftrag
					var dpf_auftrag = new dataProcessor("xml/auftragDetails.php");
					dpf_auftrag.init(auftragForm);
			
					// DataProcessor Form Vertrieb
					var dpf_vertrieb = new dataProcessor("xml/vertriebDetails.php");
					dpf_vertrieb.init(vertriebForm);
					
					// DataProcessor Form Send Vertriebsabwicklung
					var dpfs_vertriebsabwicklung = new dataProcessor("xml/vertriebsabwicklungDetails.php");
					dpfs_vertriebsabwicklung.init(vertriebsabwicklungForm);
					vertriebsabwicklungForm.load("xml/vertriebsabwicklungDetails.php?id="+rID);
					vertriebsabwicklungForm.attachEvent("onButtonClick", function(name, command){
						dpfs_vertriebsabwicklung.sendData();
					});

					// DataProcessor Form Send m. Konstruktion
					var dpfs_mkonstruktion = new dataProcessor("xml/mkonstruktionDetails.php");
					dpfs_mkonstruktion.init(mkonstruktionForm);
					mkonstruktionForm.load("xml/mkonstruktionDetails.php?id="+rID);
					mkonstruktionForm.attachEvent("onButtonClick", function(name, command){
						dpfs_mkonstruktion.sendData();
					});

				});
			}
			dhtmlxEvent(window,"load", buildInterface);
    </script>
		<style>
			html, body {
				width: 100%;
				height: 100%;
				margin: 0px;
				padding: 0px;
				overflow: hidden;
			}
		</style>
	</head>
	<body>
	</body>
</html>

I do not use a submut button in my form. I use a toolbar with a save button. If a user change data in form and clicked the save button, the update process runs with old data. After a 2nd click, the update process runs corrrectly. In sum the user had to click 2 times an the save button.
The code of log file



====================================
Log started, 11/07/2011 08:07:20
====================================

SELECT BelegNummer,Auftragswert,geliefert,bezahlt,Restwert,Kuerzel,Art,Bemerkungen FROM ablvertriebsabwicklung WHERE BelegNummer = '2001731'

Done in 0.0019540786743164s



====================================
Log started, 11/07/2011 08:07:20
====================================

SELECT BelegNummer,Auftragswert,geliefert,bezahlt,Restwert,Kuerzel,Art,Bemerkungen FROM ablvertriebsabwicklung WHERE BelegNummer = '2001731'

Done in 0.0016748905181885s



====================================
Log started, 11/07/2011 08:07:28
====================================

DataProcessor object initialized
2001731_Auftragswert => 100
2001731_geliefert => 
2001731_bezahlt => 
2001731_Restwert => 
2001731_Kuerzel => 
2001731_Art => 0
2001731_Bemerkungen => 
2001731_!nativeeditor_status => updated
ids => 2001731

Row data [2001731]
Auftragswert => 100
geliefert => 
bezahlt => 
Restwert => 
Kuerzel => 
Art => 0
Bemerkungen => 
!nativeeditor_status => updated

UPDATE ablvertriebsabwicklung SET Auftragswert='100',geliefert='',bezahlt='',Restwert='',Kuerzel='',Art='0',Bemerkungen='' WHERE BelegNummer='2001731'

Edit operation finished
0 => action:updated; sid:2001731; tid:2001731;

Done in 0.0086688995361328s



====================================
Log started, 11/07/2011 08:07:40
====================================

DataProcessor object initialized
2001731_Auftragswert => 100.000
2001731_geliefert => 
2001731_bezahlt => 
2001731_Restwert => 
2001731_Kuerzel => 
2001731_Art => 0
2001731_Bemerkungen => 
2001731_!nativeeditor_status => updated
ids => 2001731

Row data [2001731]
Auftragswert => 100.000
geliefert => 
bezahlt => 
Restwert => 
Kuerzel => 
Art => 0
Bemerkungen => 
!nativeeditor_status => updated

UPDATE ablvertriebsabwicklung SET Auftragswert='100.000',geliefert='',bezahlt='',Restwert='',Kuerzel='',Art='0',Bemerkungen='' WHERE BelegNummer='2001731'

Edit operation finished
0 => action:updated; sid:2001731; tid:2001731;

Done in 0.0064160823822021s

Can anybody tell me, what is wrong in my code or what to change?

Kindly regards
Daniel

Nobody there, who can help me or show me a functional example for the new version? I think there is something wrong with the dhtmlxForm but I can not find any errors.

I cleaned up my source code and I am sure, that this is working with 2.6 right. With 3.0 I need to send two requests.

My code

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
		<title id='title'>Auftragsbestandsliste</title>
		<link rel="stylesheet" type="text/css" href="../../dhtmlx/dhtmlx.css" />
		<script type="text/javascript" src="../../dhtmlx/dhtmlx.js"></script>
		<script type="text/javascript" src="../../dhtmlx/connector/connector.js"></script>
		<script>
			function buildInterface(){
				dhxWins = new dhtmlXWindows();
				
				// Layout
				ablLayout = new dhtmlXLayoutObject(document.body, "1C");
				ablLayout.cells("a").setText("Auftragsbestandsliste");
		
				// Grid Master
				ablGridMaster = ablLayout.cells("a").attachGrid();
				ablGridMaster.setImagePath("../../dhtmlx/imgs/");
				ablGridMaster.setHeader("Kommission,NeubauNr,Kunde,Liefertermin,KW,Auftragsart,Bestellung,Beschreibung");
				ablGridMaster.attachHeader("#text_filter,#text_filter,#select_filter,#text_filter,#select_filter,#select_filter,&nbsp;,,&nbsp;");
				ablGridMaster.setInitWidths("75,120,150,80,90,150,*,*");
				ablGridMaster.setColAlign("right,left,left,right,right,left,left,left");
				ablGridMaster.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro");
				ablGridMaster.setColSorting("int,str,str,date,str,str,str,str");
				ablGridMaster.enableMultiline(true);
				ablGridMaster.init();
				ablGridMaster.loadXML("xml/master.xml");
				//ablGridMaster.attachEvent("onRowDblClicked", function (rID){
				ablGridMaster.attachEvent("onRowSelect", function (rID){
					// Detailswindow
					if(!dhxWins.window("ablDetailsWin")){
						win = dhxWins.createWindow("ablDetailsWin",0,0,800,550);
						win.center();
						win.attachEvent("onClose",function(){
							ablAccordion.cells("a3").detachToolbar();
							ablAccordion.cells("a4").detachToolbar();
							ablAccordion.cells("a5").detachToolbar();
							win.hide;
							return true;
						});
					}
					else {
						win.show("ablDetailsWin");
						dhxWins.window("ablDetailsWin").setText("Auftrag "+rID);					
					}
					
					// Accordion 
					ablAccordion = win.attachAccordion(rID);
					ablAccordion.addItem("a1", "Auftrag");
					ablAccordion.addItem("a2", "Vertrieb");
					ablAccordion.addItem("a3", "Vertriebsabwicklung");
					ablAccordion.addItem("a4", "m. Konstruktion");
					ablAccordion.addItem("a5", "e. Konstruktion");
					ablAccordion.openItem("a1");
				
					// Toolbar Tab Vertriebsabwicklung
					vertriebsabwicklungToolbar = ablAccordion.cells("a3").attachToolbar();
					vertriebsabwicklungToolbar.setIconsPath("icons/");
					vertriebsabwicklungToolbar.loadXML("xml/vertriebsabwicklungToolbar.xml");
					vertriebsabwicklungToolbar.attachEvent("onclick",function(id){
						if(id=="saveVertriebsabwicklung"){
							vertriebsabwicklungDataProcessor.sendData();
						}
					});
				
					// Toolbar Tab m. Konstruktion
					mkonstruktionToolbar = ablAccordion.cells("a4").attachToolbar();
					mkonstruktionToolbar.setIconsPath("icons/");
					mkonstruktionToolbar.loadXML("xml/mkonstruktionToolbar.xml");
					mkonstruktionToolbar.attachEvent("onclick",function(id){
						if(id=="savemKonstruktion"){
							mkonstruktionDataProcessor.sendData();
						}
					});
					
					// Toolbar Tab e. Konstruktion
					ekonstruktionToolbar = ablAccordion.cells("a5").attachToolbar();
					ekonstruktionToolbar.setIconsPath("icons/");
					ekonstruktionToolbar.loadXML("xml/ekonstruktionToolbar.xml");
					ekonstruktionToolbar.attachEvent("onclick",function(id){
						if(id=="saveeKonstruktion"){
							ekonstruktionDataProcessor.sendData();
						}
					});
					
					// Form Auftrag
					auftragForm = ablAccordion.cells("a1").attachForm();
					auftragForm.loadStruct("xml/auftragForm.xml");
					auftragForm.load("xml/auftragDetails.php?id="+rID);					
					
					// Form Vertrieb
					vertriebForm = ablAccordion.cells("a2").attachForm();
					vertriebForm.loadStruct("xml/vertriebForm.xml");
					vertriebForm.load("xml/vertriebDetails.php?id="+rID);
					
					// Form and DataProcessor Vertriebsabwicklung
					vertriebsabwicklungForm = ablAccordion.cells("a3").attachForm();
					vertriebsabwicklungForm.loadStruct("xml/vertriebsabwicklungForm.xml");
					vertriebsabwicklungDataProcessor = new dataProcessor("xml/vertriebsabwicklungDetails.php");
					vertriebsabwicklungDataProcessor.init(vertriebsabwicklungForm);
					vertriebsabwicklungForm.load("xml/vertriebsabwicklungDetails.php?id="+rID);
					
					// Form an DataProcessor m. Konstruktion
					mkonstruktionForm = ablAccordion.cells("a4").attachForm();
					mkonstruktionForm.loadStruct("xml/mkonstruktionForm.xml");
					mkonstruktionDataProcessor = new dataProcessor("xml/mkonstruktionDetails.php");
					mkonstruktionDataProcessor.init(mkonstruktionForm);
					mkonstruktionForm.load("xml/mkonstruktionDetails.php?id="+rID);
					
				});
			}
			dhtmlxEvent(window,"load", buildInterface);
    </script>
		<style>
			html, body {
				width: 100%;
				height: 100%;
				margin: 0px;
				padding: 0px;
				overflow: hidden;
			}
		</style>
	</head>
	<body>
	</body>
</html>

I would like to use the calendar object in my forms, but in the old version it doesn´t work. Please help me to solve my problem.
Kindly regards
Daniel

PS: I included dhtmlxdataprocessor.js but I don´t know, what does it do.

We are investigating the reasons of the issue.
As fast solution, replace in your code

if(id=="savemKonstruktion"){ dpfs_mkonstruktion.sendData(); }

with

if(id=="savemKonstruktion"){ window.setTimeout(function(){ dpfs_mkonstruktion.sendData(); },1); }

It will resolve action concurrency issue.

Hi Stanislav,

nice to read of you. Thanks for support and that you are working for a solution to solve my problem. If you want, I can give you a full package of my app incl. a mysql dump. So you can try it local by yourself. Please let me know if you need this one. Then I will send you a private message with link for download.

Kindly regards
Daniel

Hi Stanislav,

I tried your suggestion to use a timeout, but it´s the same like before. The user had to click two times the save button before the updated data will send to the database. For my experiments with both library versions I am using the same files in the connector folder. Due to this, I am not able to find out what´s wrong.

Regards
Daniel

Hello,

seems like you have the problem like in this topic:
viewtopic.php?f=17&t=19301&p=61458#p61458

download 02.zip and use dhtmlxform.js from it.
remove timeouts from your code. hope it will help.

Hi Andrei,

Thanks for your answere. I tried to create a new dhtmlx.js file with libCompiler, but I don´t think, that there will included the form library you send (I copied dhtmlxform.js from your posted thread before using the libCompiler). Is it possible that you send me a complete dhtmlx.js with modificated form component?

Regards,
Daniel

Please contact us by email at support@dhtmlx.com