DataProcessor and failed XML response

Hi Everybody,

Please help me with response in xml with update status, after changes on grid. Everythings looks very simple.

  1. I have file with declarations of dhtmlxlayout, grid, dataprocessor (php)
  2. Anoteher file make changes in sql database after receive data from first file

Code of this two files
First file (it’s part of php code)

var ".$UniqueName." = new dhtmlXLayoutObject(document.body, '2E');
var ".$UniqueName."_cellA = ".$UniqueName.".cells('a');
".$UniqueName."_cellA.setText(\"Informacje ogólne\");
var ".$UniqueName."_cellB = ".$UniqueName.".cells('b');

var toolbar = ".$UniqueName.".attachToolbar();
toolbar.addButton(\"save\", 0, \"Zapisz zmiany\", \"save.gif\", \"save_dis.gif\");
toolbar.addButton(\"refresh\", 1, \"Odśwież bez zapisywania\", \"redo.gif\", \"redo_dis.gif\");

toolbar.attachEvent(\"onClick\", function(id,ind){
	if (id == 'refresh') {
	} else if (id == 'save') {

var ".$UniqueName."_cellB_Tabbar_Assumption = ".$UniqueName."_cellB.attachGrid();
var dp = new dataProcessor(\"PCCData_Assumption_Save.php\");
dp.setTransactionMode(\"POST\", true);


… and the second file

header("Content-type: text/xml");

echo('<?xml version="1.0" encoding="utf-8"?>'); 

function add_row($rowId){
     global $newId;
     return "insert";     

function update_row($rowId){
     return "update";     

function delete_row($rowId){
     return "delete";

echo "<data>";
$ids = explode(",",$_POST["ids"]);

for ($i=0; $i < sizeof($ids); $i++) { 
     $rowId = $ids[$i]; //id or row which was updated 
     $newId = $rowId; //will be used for insert operation     
     $mode = $_POST[$rowId."_!nativeeditor_status"]; //get request mode

          case "inserted":
               //row adding request
               $action = add_row($rowId);
          case "deleted":
               //row deleting request
               $action = delete_row($rowId);
               //row updating request
               $action = update_row($rowId);
     echo "<action type='".$action."' sid='".$rowId."' tid='".$newId."'/>";

echo "</data>";


Second file is now easiest as can be… I’ve delete everything except simple update function (BTW it’s copy of file from documentation)

Anyway… When I send data to second file I receive an error like in attachments (1.jpg). FireBug show correct response (?). Anyway when I click on XML in firebug report it show something like on the second attachment… In English it is something like: Error XML processing: incorrect area format: moz-nullprincipal:{6f5b22a9-e8ff-4dc2-adc9-8b0d62e5f386} Row No: 1, column 39: (…)

Where is the problem with XML?


could you provide source code of response (tab Odpowiedz if I don’t miss anything)?
By the way, you may use dhtmlxConnector for server side operations.
It will generates xml to load data and process all edit requests itself: … ndex.shtml

Hi Radyno,

You can see the xml response on first attachment (1.jpg).
<?xml version=“1.0” encoding=“utf-8”>

Maybe it will be important- when I replace the PCCData_Assumption_Save.php with xml file with identical text like response in attachment
<?xml version=“1.0” encoding=“utf-8”>,
update process run correctly and row on the grid is updated properly…

But… I still can’t find a way to update grid with this php file.

BTW. Thanks for dhtmlxConnector proposition. But now I must build aplication without it, maybe in future it will be a good idea :slight_smile:


Please, make sure that response has Content-type: text/xml.
It looks like that there are some problems here.
Response format is correct and it should work.
Maybe php-code contains any empty lines before <?php tag?