Avatar

Correct answer by
Level 10

Hi Dom,

To get the "Add Client" button working, replace the existing code with this;

var attorneyInfo = form1.Main.Clients.AttorneyInfo.instanceManager.addInstance();

attorneyInfo.ClientTable._WitnessInfo.setInstances(DeponentInfo.DeponentTable._WitnessInfo.count);

The second line sets the number of instances to match the number of witnesses that have been added.

The delete code should be using delNum in all the calls to removeInstance, tryl

var delNum = this.parent.parent.index;

for (var i = 0; i < Clients._AttorneyInfo.count; i++)

{

    var client = xfa.resolveNode("form1.Main.Clients.AttorneyInfo[" + i + "]");

    client.ClientTable.WitnessInfo.instanceManager.removeInstance(delNum);

}

this.parent.parent.instanceManager.removeInstance(delNum);

Regards

Bruce

View solution in original post