DataProcessor Parameter Passing with Delete


I have tree and grid interfaces. From tree, I’m creating a node like this which works fine:

var dp = new dataProcessor("CreateFolder.jsp"); dp.init(myTree); myTree.insertNewChild( myTree.getSelectedItemId(), //parent node id myTree.getSelectedItemId()+"/"+name.value, //new node id name.value, //new node label 'folderOpen.gif', 'folderClosed.gif'); myTree.selectItem(myTree.getSelectedItemId()+"/"+name.value, true);
However, I’m trying to delete from tree as follows, which doesn’t send parameters (which I could see in debug window):

var dp = new dataProcessor("DeleteFolder.jsp"); dp.init(myGrid); myTree.deleteItem(myTree.getSelectedItemId(), true);
And in the grid as well, it doesn’t send parameters:

var selectedFiles = myGrid.getSelectedRowId(); var dp = new dataProcessor("DeleteFiles.jsp"); dp.init(myGrid); myGrid.setUpdated(selectedFiles, true, "deleted"); myGrid.deleteRow(selectedFiles); //myGrid.deleteSelectedRows();
Could you please help?

Thanks in advance,


var dp = new dataProcessor(“CreateFolder.jsp”);
var dp = new dataProcessor(“DeleteFolder.jsp”);
var dp = new dataProcessor(“DeleteFiles.jsp”);

There can be only one dataprocessor for a component: one for grid and one for tree. And their objects needs have different name. For example:

var dpGrid = new dataProcessor(“updateGrid.jsp”);
var dpTree = new dataProcessor(“updateTree.jsp”);

You may use Connector to process data on server easily or use another approach for that (please see ready dataprocessor and connector samples).

If dataProcessor is correctly initialised, you don’t need to call setUpdated method after deleting item/row to send data to the server.


Thanks for the reply. I changed my code to have only one DP each for Grid and Tree. However, for Grid, as I mentioned earlier, it doesn’t seem to pass any parameters to my JSP. What I expect is myGrid.getSelectedRowId() so that on the server side I can take action on the selected files. Please let me know how I can pass this parameter.

I’m not using Connector because I need to use iBatis at the backend.

Thanks in advance,

Something like next can be used

dpGrid.attachEvent("onBeforeUpdate", function(){ dpGrid.serverProcessor = "updateGrid.jsp?selected="+mygrid.getSelectedRowId(); return true; })

Thanks a lot! That worked well.