Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ashutosh Agarwal on Dec 07, 2007 01:22
open dhtmlx forum
Dataprocessor problen when insert

I am adding a row in the grid with default data. User changes the default data. User selects another row. This results in server side call for insert operation. I am using dataprocessor. But the problem is for the same row the it is making insert opertion twice. Which results in error. Please find the code.

Please resolve this at earliest.

file dhtmlx.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <title>dhtmlx test page</title>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

        <!-- disabling caching -->
        <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache" />
        <META HTTP-EQUIV="Pragma" CONTENT="No-cache" />
        <META HTTP-EQUIV="Expires" CONTENT="0" />
        
        <link rel="STYLESHEET" type="text/css" href="css/dhtmlxgrid/dhtmlxgrid.css">
        <script>_css_prefix="js/dhtmlxgrid/"; _js_prefix="css/dhtmlxgrid/"; </script>
        <script src="js/dhtmlxgrid/dhtmlxcommon.js"></script>
        <script src="js/dhtmlxgrid/dhtmlxgrid.js"></script>
        <script src="js/dhtmlxgrid/dhtmlxgridcell.js"></script>
        <!-- for pagination -->
        <script src="js/dhtmlxgrid/ext/dhtmlxgrid_pgn.js"></script>
            
        <!-- for pagination toolbar -->
        <script type="text/javascript" src="js/dhtmlxToolbar/dhtmlxprotobar.js"></script>
        <script type="text/javascript" src="js/dhtmlxToolbar/dhtmlxtoolbar.js"></script>
        
        <!-- for frozen columns -->
        <script type="text/javascript" src="js/dhtmlxgrid/ext/dhtmlxgrid_splt.js"></script>
        
        <!-- serialize to csv     -->
        <script type="text/javascript" src="js/dhtmlxgrid/ext/dhtmlxgrid_nxml.js"></script>
    
        <!-- for smart rendering -->
        <script type="text/javascript" src="js/dhtmlxgrid/ext/dhtmlxgrid_srnd.js"></script>
        <!-- for data processing -->
        <script type="text/javascript" src="js/dhtmlxgrid/dhtmlxdataprocessor.js"></script>
        
        
        <link rel='STYLESHEET' type='text/css' href="css/dhtmlxgrid/commonstyle.css">
        <link rel="STYLESHEET" type="text/css" href="css/dhtmlxgrid/dhtmlxgrid_skins.css">
        <!-- for pagination toolbar -->
        <link rel="stylesheet" href="css/dhtmlxToolbar/dhtmlxtoolbar.css" type="text/css"></link>
        <script type="text/javascript" src="js/dhtmlx.js">
        </script>
<style>
.even{
background-color:#E6E6FA;
}
.uneven{
background-color:#F0F8FF;
}
</style>

</head>

    <body onload="intializeTheGrid()">
    <table width="90%">
        <tr>
            <td id="recinfoArea"></td>
        </tr>
        <tr>
            <td>
                <div id="gridbox" style="width:100%; height:175px;
                background-color:white; overflow:hidden;" class="gridbox"></div>
            </td>
        </tr>
        <tr>
            <td id="pagingArea"></td>
        </tr>
    </table>

        <BR>
        <input type="Button" name="loadData" value="LoadData" onclick="loadData()" />

        <div style="margin:20px;">
        <table border="0">
        <tr>
            <td>Choose skin to apply:
                <select onchange="mygrid.setSkin(this.value)" >
                    <option value="gray">gray
                    <option value="mt">mt
                    <option value="xp" selected>xp
                    <option value="clear">clear
                    <option value="modern">modern
                    <option value="light">light
                </select>
            </td>
            <td>
                <input type="Button" name="resizeColumns" onclick="resizeColumns()" value="ResizeColumns"
                    title="ResizeColumns" />
        </td>
        </tr>
        </table>
    </div>
    <div>
        <table>
         <tr>
         <td>
                <a href="javascript:void(0)" onclick="insertRow('10000')">Add Row at the top</a>
            </td>
            <td>
                <a href="javascript:void(0)" onclick="mygrid.deleteRow(window.prompt('Row[index] to delete'))">Delete Row by index</a>
            </td>
         </tr>
        </table>

    </div>
    <div>
    <input type="Button" name="exportToCsv" onclick="exportToCsv('csvTextArea')" value="exportToCsv"
        title="exportToCsv" /><BR/>
    <textarea rows="10" cols="80" id="csvTextArea"></textarea>
    </div>
    </body>
</html>


dhtmlx.js file

// global varables
var mygrid = null;
function intializeTheGrid() {
    dhtmlxError.catchError("ALL", error_handler);
    mygrid = new dhtmlXGridObject("gridbox");
    mygrid.setImagePath("images/dhtmlxgrid/");
    mygrid.setOnLoadingEnd(on_load_end);
    mygrid.init();
    
    //mygrid.preventIECaching(true);
}
function loadData() {
    mygrid.clearAll();
    mygrid.enableAlterCss("even", "uneven");
    //mygrid.enableSmartRendering(true);
    mygrid.enablePaging(true, 10, 4, "pagingArea", true, "recinfoArea");
    mygrid.enableColumnAutoSize(true);
    //mygrid.enablePagingWT(true,10,null,"recinfoArea");
    eventsCode(mygrid);
    var baseUrl = "http://localhost:10080/haviNonReceipe/";
    var requestString1 = baseUrl + "drawQuantities.htm?action=listDrawQuantitiesAutoLoading" + "&uniqueParam=" + Date.parse(new Date());
    mygrid.setXMLAutoLoading(requestString1, 10);
    //mygrid.splitAt(2);
    var requestString = baseUrl + "drawQuantities.htm?action=listDrawQuantities" + "&uniqueParam=" + Date.parse(new Date());
    mygrid.loadXML(requestString, function () {
        //var totalCount = mygrid.getUserData("","totalCount");
        //alert("totalCount:" + totalCount);
        //alert("hi");
        //mygrid.setSizes();
        
        resizeColumns();
    });
    
    setTheDataProcessor(mygrid, baseUrl);
    //mygrid.setOnCheckHandler(OnCheckHandler);
    //mygrid.setOnEditCellHandler(doOnCellEdit);
}

function insertRow(id){
    var myArray = new Array(mygrid.getColumnCount());
//100,CNR HEATHERTON & SPRINGVALE ROADS,Y,01/01/2006,N,Y,Robert Michalak,
//16/09/2006,30,02/07/2006,Y,N,Robert Michalak,14/06/2006,99,14/06/2006,Pre-determined,Y
    myArray[0] = id;
    myArray[1] = "CNR HEATHERTON & SPRINGVALE ROADS";
    myArray[2] = "Y";
    myArray[3] = "01/01/2006";
    myArray[4] = "N";
    myArray[5] = "Y";
    myArray[6] = "Robert Michalak";
    myArray[7] = "16/09/2006";
    myArray[8] = 30;
    myArray[9] = "02/07/2006";
    myArray[10] = "Y";
    myArray[11] = "N";
    myArray[12] = "Robert Michalak";
    myArray[13] = "14/06/2006";
    myArray[14] = 99;
    myArray[15] = "14/06/2006";
    myArray[16] = "Pre-determined";
    myArray[17] = false;
    
    mygrid.addRow(id, myArray, 0);
}
function setTheDataProcessor(grid, baseUrl){
    myDataProcessor = new dataProcessor(baseUrl + "drawQuantities.htm?action=dataProcessing");
//use column IDs instead of column indexes naming request parameters
myDataProcessor.enableDataNames(true);
//verify if the value of 2nd column (zero-based numbering is 1) is not empty
// myDataProcessor.setVerificator(1)
//verify value of 4th column (zero-based numbering is 3) against checkIfNotZero verification function (see it below)
// myDataProcessor.setVerificator(3,checkIfNotZero)
//you can also specify update mode. Availabel modes are: update automaticaly (cell based, row based) and manual update
//cell ("cell") based mode means that grid will attempt to update data on server after each editing of cell (on editor closed).
//row ("row") based mode means that grid will attempt to update data on server when row selection changed or Enter key pressed
//manual ("off") means that you need to run myDataProcessor.sendData() to begin update process (automatic update off).
myDataProcessor.setUpdateMode("row");//available values: cell (default), row, off
//set error handler (handler for action with type "error")
myDataProcessor.defineAction("update", function my_handler(xml_node){
                                         alert(xml_node.getAttribute("tid"));
                                     return true;
                                            }
                                );
     myDataProcessor.defineAction("insert", function my_handler(xml_node){
                                             //alert(xml_node.data);
                                         //alert(xml_node.getAttribute("tid"));
                                         //alert(xml_node.getAttribute("sid"));
                                         try{
                                         var oldRowId = xml_node.getAttribute("sid");
                                         var newRowId = xml_node.getAttribute("tid");
                                         var restId = mygrid.cells(oldRowId,0);
                                         restId.setValue(newRowId);
                                         }catch(e){ }
                                         //alert(mygrid.getRowId(xml_node.getAttribute("tid")));
                                     return true;
                                            }
                                );
     myDataProcessor.defineAction("delete", function my_handler(xml_node){
                                         alert(xml_node.getAttribute("tid"));
                                     return true;
                                            }
                                );
myDataProcessor.defineAction("error",myErrorHandler);
//specify transaction method - POST or GET (default is GET)
myDataProcessor.setTransactionMode("POST");
//initialize data processor for the grid object (in our case - mygrid)
myDataProcessor.init(mygrid);
}

//============================================================================================
//Example of error handler. It gets <action> tag object as incomming argument.
function myErrorHandler(obj){
alert("Error occured.\n"+obj.firstChild.nodeValue);
myDataProcessor.stopOnError = true;
return false;
}

//Example of verification function. It verifies that value is not 0 (zero).
//If verification failed it should return false otherwise true.
//Verification fucntion specified in setVerificator method will always get two argumentrs: value to verify and column name (use it for message)
function checkIfNotZero(value,colName){
if(value.toString()._dhx_trim()=="0"){
showMessage(colName+ " should not be 0")
return false
}else
return true;
}

function resizeColumns(){    
    try{
    var columnCount = mygrid.getColumnCount();
    }catch(e){
        //alert(e.message);
    }
    for(var i = 0; i < columnCount ; i++){
        mygrid.adjustColumnSize(i);
    }
}
function on_load_end(grid) {
//alert("Portion sucesfully loaded");
}
function error_handler(type, name, param) {
    alert("Seems that somehow next error occurs \n" + type + " : " + name + " : " + param);
}
function exportToCsv(textAreaID) {
    mygrid.setCSVDelimiter(" | ");    //chnage csv delimiter
    var csvNew = mygrid.serializeToCSV();
    var textArea = document.getElementById(textAreaID);
    textArea.value = csvNew;
}
function doOnCheck(rowId, cellInd, state) {
    // Event raises after state was changed. for checkbox and radio button cell
    alert("doOnCheck: " + rowId + ":" + cellInd + ":" + state);
    return true;
}
function doOnBeforeRowDeleted(rowId) {
    // Event raised right before row deleted (if returns false, deletion canceled)
    alert("doOnBeforeRowDeleted: " + rowId);
    return true;
}
function doOnRowAdded(rowId) {
    // Event raised right after row was added to grid
    alert("doOnRowAdded: " + rowId);
    return true;
}
function doOnEnter(rowId, cellInd) {
// Event raised immideatly after Enter pressed.
    alert("doOnEnter: " + rowId + ":" + cellInd);
    return true;
}
function doOnCellEdit(stage, rowId, cellInd, newvalue, oldValue) {
    // new value and old value only for stage 2
    // Event raises 1-3 times depending on cell type and settings
    alert("doOnCellEdit: " + stage + ":" + rowId + ":" + cellInd + ":" + newvalue + ":" + oldValue);
    if (stage == 0) { // before start
        return true;
    } else {
        if (stage == 1) { //1-editor opened
        } else {
            if (stage == 2) { //2-editor closed
            }
        }
    }
    return true;
}
function doOnCellChanged(rowID, cellInd, newvalue) {
    alert("doOnCellChanged: " + rowID + ":" + cellInd + ":" + newvalue);
    return true;
    // mygrid
}
function doOnScroll(scrollLeft, scrollTop) {
    //Event raised immideatly after scrolling occured
    alert("doOnScroll: " + scrollLeft + ":" + scrollTop);
    return true;
}
function doOnPageChanged(myCurrentPage, myStartRowInd, myPage) {
    alert("doOnPageChanged: " + myCurrentPage + ":" + myStartRowInd + " : " + myPage);
    return true;
}
function doOnRowSelect(rowID, cellInd) {
    //Event raised immideatly after row was clicked.
    alert("doOnRowSelect: " + rowID + ":" + cellInd);
    return true;
}
function doOnBeforeSelect(newSelectedRow, oldSelectedRow) {
    //event fired moment before row in grid get selection.
    alert("doOnBeforeSelect: " + newSelectedRow + ":" + oldSelectedRow);
    return true;
}
function doOnRowCreated(rowId, rowObject, relatedXml) {
    // event fired after row created in grid, and filled with data
    alert("doOnRowCreated: " + rowId + ":" + rowObject + " : " + relatedXml);
    return true;
}
function doOnBeforeSorting(colIndex, gridObject, sortingDirection) {
    // event called before sorting of data started
    alert("doOnBeforeSorting: " + colIndex + ":" + gridObject + " : " + sortingDirection);
    return true;
}
function eventsCode(grid) {
    //grid.setOnRowSelectHandler(doOnRowSelect);
    //grid.setOnEditCellHandler(doOnCellEdit);
    //grid.setOnEnterPressedHandler(doOnEnter);
    //grid.setOnCheckHandler(doOnCheck);
    //grid.setOnPageChanged(doOnPageChanged);
    //grid.setOnBeforeRowDeletedHandler(doOnBeforeRowDeleted); // set function called before row removed from grid
    //grid.setOnRowAddedHandler(doOnRowAdded); //set function called after row added to grid
    //grid.setOnBeforeSelect(doOnBeforeSelect); // set function called moment before row selected in grid
    //grid.setOnRowCreated(doOnRowCreated); // set function called after row created
    //grid.setOnCellChanged(doOnCellChanged); // set function called after value of cell changed by user actions
    //grid.setOnColumnSort(doOnBeforeSorting); // set function called before sorting of data started, didn't occur while calling grid.sortRows
}

first time request for data
GET /haviNonReceipe/drawQuantities.htm?action=listDrawQuantities&uniqueParam=1196875038000&rowsLoaded=0&lastid=null&a_dhx_rSeed=1196875038557 HTTP/1.1
Accept: */*
Accept-Language: en-us
Referer: http://localhost:8080/haviNonReceipe/dhtmlx.html
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: localhost:8080
Connection: Keep-Alive
Cookie: JSESSIONID=0C373B66D0712467BD1F4445E4FF42E5

response data
HTTP/1.1 200 OK
Set-Cookie: JSESSIONID=3EC699591578307980B6C6D774AFA2E5; Path=/haviNonReceipe
Cache-Control: no-cache
Pragma: No-cache
Expires: 0
Content-Type: text/xml;charset=UTF-8
Content-Language: en-US
Content-Length: 8103
Date: Wed, 05 Dec 2007 17:17:18 GMT
Server: Apache-Coyote/1.1


<rows total_count='50'>
    <head>
    <beforeInit>
        <call command="setSkin"><param>xp</param></call>
    </beforeInit>
    <afterInit>
<call command="splitAt"><param>2</param></call>
    </afterInit>
    <column width="100" type="ed" align="right" color="white" sort="int" id="restId">RestId</column>
    <column width="100" type="ed" align="right" color="white" sort="str" id="restDescription">Rest Description</column>
    <column width="100" type="ed" align="right" color="white" sort="str" id="eligible">Eligible</column>
    <column width="100" type="ed" align="right" color="white" sort="str" id="eligibilityDate">Eligibility Date</column>
    <column width="100" type="co" align="left" color="white" sort="str" id="pmixViaPoller">PMIX via poller
        <option value="Y">Y</option>
    <option value="N">N</option>
</column>
    <column width="100" type="co" align="right" color="white" sort="str" id="jdeDC">JDE DC
        <option value="Y">Y</option>
    <option value="N">N</option>
</column>
    <column width="100" type="co" align="right" color="white" sort="str" id="ropPlanner">ROP Planner
        <option value="Robert Michalak">Robert Michalak</option>
    <option value="Eric Pfeiffer">Eric Pfeiffer</option>
    <option value="Bill Duross">Bill Duross</option>
    <option value="Nick Spurck">Nick Spurck</option>
    </column>
    <column width="100" type="ed" align="right" color="white" sort="date" id="dateOfCashlessReceipts">Date of cashless receipts</column>
    <column width="100" type="ed" align="right" color="white" sort="str" id="noOfDaysPmixHist"># days PMIX hist</column>
    <column width="100" type="ed" align="right" color="white" sort="str" id="dateOfSomeAttribute">Date of some attribute</column>
    <column width="100" type="co" align="right" color="white" sort="str" id="someAttribute">Some Attr
        <option value="Y">Y</option>
    <option value="N">N</option>
</column>
    <column width="50" type="co" align="right" color="white" sort="str" id="anotherAttribute">Another Attribute
        <option value="Y">Y</option>
    <option value="N">N</option>
</column>
    <column width="50" type="co" align="right" color="white" sort="str" id="dcPeople">DC People
        <option value="Robert Michalak">Robert Michalak</option>
    <option value="Eric Pfeiffer">Eric Pfeiffer</option>
    <option value="Bill Duross">Bill Duross</option>
    <option value="Nick Spurck">Nick Spurck</option>
    </column>
    <column width="50" type="ed" align="right" color="white" sort="str" id="someDate">Some Date</column>
    <column width="50" type="ed" align="right" color="white" sort="str" id="noOfDaysReceipts"># days receipts</column>
    <column width="50" type="ed" align="right" color="white" sort="str" id="someDate2">Some Date2</column>
    <column width="50" type="co" align="right" color="white" sort="str" id="someSelectionList">Some Selection List
        <option value="Pre-determined">Pre-determined</option>
    <option value="Orthogonal">Orthogonal</option>
    <option value="Minimum">Minimum</option>
    <option value="Insufficient">Insufficient</option>
    </column>
    <column width="50" type="ch" align="center" color="white" sort="na" id="complete">Is complete</column>
</head>
        <row id="100">
            <cell>100</cell>
            <cell>CNR HEATHERTON & SPRINGVALE ROADS</cell>
            <cell>Y</cell>
            <cell>01/01/2006</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Robert Michalak</cell>
            <cell>09/16/2006</cell>
            <cell>30</cell>
            <cell>07/02/2006</cell>
            <cell>Y</cell>
            <cell>N</cell>
            <cell>Robert Michalak</cell>
            <cell>06/14/2006</cell>
            <cell>99</cell>
            <cell>06/14/2006</cell>
            <cell>Pre-determined</cell>
            <cell>true</cell>
        </row>
        <row id="101">
            <cell>101</cell>
            <cell>123 MAIN ST & BUTTERFIELD ROAD</cell>
            <cell>Y</cell>
            <cell>12/31/2004</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Eric Pfeiffer</cell>
            <cell>09/16/2006</cell>
            <cell>25</cell>
            <cell>08/02/2007</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Eric Pfeiffer</cell>
            <cell>06/20/2007</cell>
            <cell>101</cell>
            <cell>06/20/2007</cell>
            <cell>Orthogonal</cell>
            <cell>false</cell>
        </row>
        <row id="102">
            <cell>102</cell>
            <cell>OGDEN AVE & HOBSON ROAD</cell>
            <cell>N</cell>
            <cell></cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Bill Duross</cell>
            <cell>02/05/2004</cell>
            <cell>25</cell>
            <cell>03/13/2006</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Bill Duross</cell>
            <cell>03/03/2001</cell>
            <cell>33</cell>
            <cell>03/03/2001</cell>
            <cell>Minimum</cell>
            <cell>false</cell>
        </row>
        <row id="103">
            <cell>103</cell>
            <cell>450 ROOSEVELT - LOMBARD</cell>
            <cell>N</cell>
            <cell></cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Nick Spurck</cell>
            <cell>03/17/2007</cell>
            <cell>30</cell>
            <cell>03/13/2006</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Nick Spurck</cell>
            <cell>12/12/2002</cell>
            <cell>23</cell>
            <cell>12/12/2002</cell>
            <cell>Insufficient</cell>
            <cell>true</cell>
        </row>
        <row id="104">
            <cell>104</cell>
            <cell>409 ROOSEVELT - OAKBROOK TERRACE</cell>
            <cell>Y</cell>
            <cell>07/04/1995</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Robert Michalak</cell>
            <cell>04/01/1996</cell>
            <cell>2</cell>
            <cell>10/10/2007</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Robert Michalak</cell>
            <cell>12/23/2003</cell>
            <cell>0</cell>
            <cell>12/23/2003</cell>
            <cell>Pre-determined</cell>
            <cell>false</cell>
        </row>
        <row id="105">
            <cell>105</cell>
            <cell>CNR HEATHERTON & SPRINGVALE ROADS</cell>
            <cell>Y</cell>
            <cell>01/01/2006</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Eric Pfeiffer</cell>
            <cell>09/16/2006</cell>
            <cell>30</cell>
            <cell>07/02/2006</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Eric Pfeiffer</cell>
            <cell>06/14/2006</cell>
            <cell>99</cell>
            <cell>06/14/2006</cell>
            <cell>Orthogonal</cell>
            <cell>true</cell>
        </row>
        <row id="106">
            <cell>106</cell>
            <cell>123 MAIN ST & BUTTERFIELD ROAD</cell>
            <cell>Y</cell>
            <cell>12/31/2004</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Bill Duross</cell>
            <cell>09/16/2006</cell>
            <cell>25</cell>
            <cell>08/02/2007</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Bill Duross</cell>
            <cell>06/20/2007</cell>
            <cell>101</cell>
            <cell>06/20/2007</cell>
            <cell>Minimum</cell>
            <cell>false</cell>
        </row>
        <row id="107">
            <cell>107</cell>
            <cell>OGDEN AVE & HOBSON ROAD</cell>
            <cell>N</cell>
            <cell></cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Nick Spurck</cell>
            <cell>02/05/2004</cell>
            <cell>25</cell>
            <cell>03/13/2006</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Nick Spurck</cell>
            <cell>03/03/2001</cell>
            <cell>33</cell>
            <cell>03/03/2001</cell>
            <cell>Insufficient</cell>
            <cell>true</cell>
        </row>
        <row id="108">
            <cell>108</cell>
            <cell>450 ROOSEVELT - LOMBARD</cell>
            <cell>N</cell>
            <cell></cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Robert Michalak</cell>
            <cell>03/17/2007</cell>
            <cell>30</cell>
            <cell>03/13/2006</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Robert Michalak</cell>
            <cell>12/12/2002</cell>
            <cell>23</cell>
            <cell>12/12/2002</cell>
            <cell>Pre-determined</cell>
            <cell>false</cell>
        </row>
        <row id="109">
            <cell>109</cell>
            <cell>409 ROOSEVELT - OAKBROOK TERRACE</cell>
            <cell>Y</cell>
            <cell>07/04/1995</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Eric Pfeiffer</cell>
            <cell>04/01/1996</cell>
            <cell>2</cell>
            <cell>10/10/2007</cell>
            <cell>N</cell>
            <cell>Y</cell>
            <cell>Eric Pfeiffer</cell>
            <cell>12/23/2003</cell>
            <cell>0</cell>
            <cell>12/23/2003</cell>
            <cell>Orthogonal</cell>
            <cell>true</cell>
        </row>
        
        <userdata name="totalCount">50</userdata>
        
</rows>

POST /haviNonReceipe/drawQuantities.htm?action=dataProcessing& HTTP/1.1
Accept: */*
Accept-Language: en-us
Referer: http://localhost:8080/haviNonReceipe/dhtmlx.html
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: localhost:8080
Content-Length: 463
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=3EC699591578307980B6C6D774AFA2E5


gr_id=10000&restId=10000&restDescription=CNR%20HEATHERTON%20%26amp%3B%20SPRINGVALE%20ROADS&eligible=Y&eligibilityDate=01/01/2006&pmixViaPoller=N&jdeDC=Y&ropPlanner=Robert%20Michalak&dateOfCashlessReceipts=16/09/2006&noOfDaysPmixHist=30&dateOfSomeAttribute=02/07/2006&someAttribute=Y&anotherAttribute=N&dcPeople=Robert%20Michalak&someDate=14/06/2006&noOfDaysReceipts=99&someDate2=14/06/2006&someSelectionList=Pre-determined&complete=0&!nativeeditor_status=inserted

response data
HTTP/1.1 200 OK
Content-Type: text/xml;charset=UTF-8
Content-Length: 58
Date: Wed, 05 Dec 2007 17:17:24 GMT
Server: Apache-Coyote/1.1

<data><action type='insert' sid='10000' tid='510'/></data>

second time also it is making the request.

POST /haviNonReceipe/drawQuantities.htm?action=dataProcessing& HTTP/1.1
Accept: */*
Accept-Language: en-us
Referer: http://localhost:8080/haviNonReceipe/dhtmlx.html
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Host: localhost:8080
Content-Length: 463
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=3EC699591578307980B6C6D774AFA2E5

gr_id=10000&restId=10000&restDescription=CNR%20HEATHERTON%20%26amp%3B%20SPRINGVALE%20ROADS&eligible=Y&eligibilityDate=01/01/2006&pmixViaPoller=N&jdeDC=Y&ropPlanner=Robert%20Michalak&dateOfCashlessReceipts=16/09/2006&noOfDaysPmixHist=30&dateOfSomeAttribute=02/07/2006&someAttribute=Y&anotherAttribute=N&dcPeople=Robert%20Michalak&someDate=14/06/2006&noOfDaysReceipts=99&someDate2=14/06/2006&someSelectionList=Pre-determined&complete=0&!nativeeditor_status=inserted

response:
HTTP/1.1 200 OK
Content-Type: text/xml;charset=UTF-8
Content-Length: 58
Date: Wed, 05 Dec 2007 17:17:24 GMT
Server: Apache-Coyote/1.1

<data><action type='insert' sid='10000' tid='511'/></data>
Answer posted by Support on Dec 07, 2007 02:54
You source code contains one potencial problematic place which can cause issue

function loadData() {
    ... 
    setTheDataProcessor(mygrid, baseUrl);
}

function setTheDataProcessor(grid, baseUrl){
    ...
    myDataProcessor.init(mygrid);
}

There is possiblity that loadData function called twice and in result two instances of dataProcessor will be attached to the same grid, which will result in sending two "insert" actions instead of one.
Please be sure that only one instance of dataProcessor attached to grid.

Answer posted on Dec 07, 2007 03:25