3.0.5

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
September 9,
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)
September 11,
It worked. Thank you.
Matt
September 13,
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();
August 24,

This topic is archived.

See also:


Back to support forum