J
John
I have a repeating table that has an event handler ( OnAfterChange) that
works on the first entry, but when a new entry is added to the table, the
event handler doesn't work. Shouldn't this work on each entry on the entire
table? Here is the code below:
function msoxd_exp_rate::OnAfterChange(oEvent)
{
// Write code here to restore the global state.
if (oEvent.IsUndoRedo)
{
// An undo or redo operation has occurred and the DOM is read-only.
return;
}
// A field change has occurred and the DOM is writable.
var xmlDom = XDocument.DOM
var xmlTotal =
xmlDom.selectSingleNode("/exp:expenseReport/exp:items/exp:item/exp:totalAmount");
var xmlAmount =
xmlDom.selectSingleNode("/exp:expenseReport/exp:items/exp:item/my:amount");
var xmlRate =
xmlDom.selectSingleNode("/exp:expenseReport/exp:items/exp:item/exp:rate");
setNodeValue(xmlTotal, (getNodeTypedValue(xmlAmount,0,true) /
getNodeTypedValue(xmlRate,0,true)));
calcTotals();
}
works on the first entry, but when a new entry is added to the table, the
event handler doesn't work. Shouldn't this work on each entry on the entire
table? Here is the code below:
function msoxd_exp_rate::OnAfterChange(oEvent)
{
// Write code here to restore the global state.
if (oEvent.IsUndoRedo)
{
// An undo or redo operation has occurred and the DOM is read-only.
return;
}
// A field change has occurred and the DOM is writable.
var xmlDom = XDocument.DOM
var xmlTotal =
xmlDom.selectSingleNode("/exp:expenseReport/exp:items/exp:item/exp:totalAmount");
var xmlAmount =
xmlDom.selectSingleNode("/exp:expenseReport/exp:items/exp:item/my:amount");
var xmlRate =
xmlDom.selectSingleNode("/exp:expenseReport/exp:items/exp:item/exp:rate");
setNodeValue(xmlTotal, (getNodeTypedValue(xmlAmount,0,true) /
getNodeTypedValue(xmlRate,0,true)));
calcTotals();
}