:: Forum >>

Copy XML talbes

I'm trying to copy a table, into two other tables, but all I'm getting is the reference to each other.

var tableOrder = new Active.XML.Table;
    tableOrder.setURL("http://12pcroom/QuoteFeedback/template/Get_Codes.xml");
    var tableReason = tableOrder;
    var tableComp = tableOrder;
    tableOrder.setRows("//root/OrderStatusCodes");
    tableReason.setRows("//root/ReasonCodes");
    tableComp.setRows("//root/Competitors");
    tableOrder.request();
    tableReason.request();
    tableComp.request();


The main reason, is I don't want my SQL being accessed three times, for the same data. I tired obj.getXML(); with no luck.

var tableReason = tableOrder.getXML();

When I go to read a value from tableReason, is gives me an error saying it's null or not an object
Matt
Thursday, September 9, 2004
You have to override 'response' method of one table and pass the xml to all three.

var tableOrder = new Active.XML.Table;
var tableReason = new Active.XML.Table;
var tableComp = new Active.XML.Table;

tableOrder.setRows("//root/OrderStatusCodes");
tableReason.setRows("//root/ReasonCodes");
tableComp.setRows("//root/Competitors");

tableOrder.setURL("http://12pcroom/QuoteFeedback/template/Get_Codes.xml");

var _response = tableOrder.response;
tableOrder.response = function(xml){
_response.call(this, xml);
tableReason.setXML(xml);
tableComp.setXML(xml);
}

tableOrder.request();
Alex (ActiveWidgets)
Saturday, September 11, 2004
It worked. Thank you.
Matt
Monday, September 13, 2004
var tableOrder = new Active.XML.Table;
var tableReason = new Active.XML.Table;
var tableComp = new Active.XML.Table;

tableOrder.setRows("//root/OrderStatusCodes");
tableReason.setRows("//root/ReasonCodes");
tableComp.setRows("//root/Competitors");

tableOrder.setURL("http://12pcroom/QuoteFeedback/template/Get_Codes.xml");

var _response = tableOrder.response;
tableOrder.response = function(xml){
_response.call(this, xml);
tableReason.setXML(xml);
tableComp.setXML(xml);
}

tableOrder.request();
Wednesday, August 24, 2005

This topic is archived.


Back to support forum

Forum search