cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting references in table of form / Performance

0 Kudos

Hello,

I've got an interactive form with a table in subform. This is filled with 750 entries (references). I'm deleting all entries from index 1 to 749 in event "preSubmit" of the mail-button with JavaScript. Only the entry with index 0 is not deleted.

Something like this:

var colEntries = xfa.form.resolveNodes("xfa.form.data.Body.....DATA[*]");

for (var i=1; i<colEntries.length; i++){

xfa.form.data.Body.....DATA.instanceManager.removeInstance(i);

};

This is very slow. Do you know a faster way to remove the entries?

Regards,

Ole.

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

Hello,

it works! Thanks for your help!

Ole.

0 Kudos

Hi,

the entry with index 0 should not be deleted. I've added all entries to the table dynamically with JavaScript because of a user selection. For every new user selection I have to delete the old entries first before I can add the new ones. And the deleting-step takes up to 3 Minutes. That a long time ;-)!

Ole.

Former Member
0 Kudos

Hi Ole,

use the setInstance method as in below script example.

form1.abc.Table1.Row1.instanceManager.setInstances(1);

Let me know if this doesn't work for you.

Cheers,

Sai

Former Member
0 Kudos

Hi,

The index starts from 0, check with that.

And the code you had is the best as far as I know, but before form is loaded if you aready know what need to be visibile on the screen then remove the 700 odd entries in the src or interface itself why to do it in form. this will increase performance.

Cheers,

Sai