Avatar

Not applicable

Hi,

I have to  2 subforms,name table_subform[0] and table_subform[1] .

To add a new table , i use script :

var sSubformSOM = "xfa.form.form1.page1.table_subform";

var oSubform = xfa.resolveNode(sSubformSOM);    

var sParentSOM = oSubform.parent.somExpression;   

var sManagerSOM = sParentSOM + "._" + oSubform.name+ "["+ 1 +"]"; ;  // Control the the new table location

var oManager = xfa.resolveNode(sManagerSOM);

oManager.addInstance(1);

PROBLEM : , the this add table function "ADD THE NEW TABLE IN BETWEEN table_subform[0] and table_subform[1].

REQUIREMENT : The new table should added next to the last table.

SOLUTION 1 : var sManagerSOM = sParentSOM + "._" + oSubform.name + "["+ 1 +"]"; // index 1 to add the new table next to the second table

var sSubformSOM = "xfa.form.form1.page1.table_subform";

var oSubform = xfa.resolveNode(sSubformSOM);   

var sParentSOM = oSubform.parent.somExpression;   

var sManagerSOM = sParentSOM + "._" + oSubform.name+ "["+ 2 +"]"; ;  // Control the the new table location

var oManager = xfa.resolveNode(sManagerSOM);

oManager.addInstance(1);

PROBLEM : NOW all my "new table" are added by reference to oSubform.name + "["+ 1 +"]";  OR oSubform.name[1]

                   Now the add table are working fine.

                    But this create an issue when deleting the table from the same subform.

                     If i click the "Delete table at "table_subform[1] - which index is used to create the rest of the tables" , it delete      table_subform[2],table_subform[3] in sequence.

----------------------------------------------------------------------------------------------------------------------------------------

Anyone have any solution for this ????