or
var ArbolPresupuestoConfigurator_ReceiveData = function (nodesConfig) {and the code caller function from child window is:
/*
nodesConfig is a object passed to the function and the following is the structure of the object
var nodesConfig = {
nodes: null,
level: '',
idFlota: 0
}
where 'nodes' is the object that contains the root node (with child nodes) from the child window.*/
if (nodesConfig != null) {
switch (nodesConfig.level) {
case 'Flota':
var nodoFlota = nodesConfig.nodes.get_nodes().getNode(0)
if (nodoFlota != null) {
var esFlotaPersonalizada = nodoFlota.get_attributes().getAttribute('EsPersonalizada');
if (esFlotaPersonalizada == 'True') {
var nombreFlota = nodoFlota.get_text();
} else {
var idFlota = nodoFlota.get_value();
//The exception is fired here from the second time the function is called.
//treeArbolPresupuesto is the parent window treeview
var _currentNodoFlota = treeArbolPresupuesto.findNodeByValue(idFlota)
if (_currentNodoFlota != null) {
if (nodoFlota.get_nodes().get_count() > 0) {
treeArbolPresupuesto.trackChanges();
var nuevaActividad = nodoFlota.get_nodes().getNode(0);
_currentNodoFlota.get_nodes().getNode(0).get_nodes().add(nuevaActividad);
treeArbolPresupuesto.commitChanges();
}
}
}
}
break;
case 'Actividad':
break;
case 'Area':
break;
case 'Sistema':
break;
case 'SubSistema':
break;
case 'Material':
break;
}
}
}
var wizardToolbar_HandleButtonClick = function (sender, eventArgs) {Actually I am very upset with this problem since I have not found a solution and I promptly deliver development.
var button = eventArgs.get_item();
var commandName = button.get_commandName();
switch (commandName) {
case 'SaveAll':
//RootNode is the root node of the treeview in child window
var rootNode = treeConfig.findNodeByValue('-100');
nodesConfig.nodes = rootNode;
GetRadWindow().BrowserWindow.ArbolPresupuestoConfigurator_ReceiveData(nodesConfig);
GetRadWindow().close();
break;
case 'Cancel':
//TODO: Pendiente implementar.
GetRadWindow().close();
break;
case 'Undo':
window.location.reload();
break;
case 'Help':
//TODO: Pendiente implementar.
break;
}
}