Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Problem with addinstance - removeinstances

Avatar

Level 2

Dear all,

I have a strange problem

My PDF has a master page which contains the header data : user who generates the pdf from SAP (the user field is binded), name (binded too)

In my form I have a table and 2 buttons : one to add row and one to remove row

The javascript on each button is onclick

ADD : form._myitem.addInstance(0);

REMOVE : if

(form._myitem.count > 1)

form._myitem.removeInstance(form._myitem.count

- 1);

If I chain an ADD click + a REMOVE click + a ADD click, the user and the name are deleted from the header

Do you have an idea ?

0 Replies

Avatar

Level 6

Change to following

ADD : form._myitem.addInstance(1);

xfa.form.recalculate(1);

form._myitem.count > 1) form._myitem.removeInstance(form._myitem.count- 1);

REMOVE : if (

xfa.form.recalculate(1);

Avatar

Level 6

Change to following

xfa.form.recalculate(1);

REMOVE : if (form._myitem.count > 1) form._myitem.removeInstance(form._myitem.count- 1);

xfa.form.recalculate(1);

ADD : form._myitem.addInstance(1);

Avatar

Level 6

Change to following

ADD : form._myitem.addInstance(1);
xfa.form.recalculate(1);


REMOVE : if (form._myitem.count > 1) form._myitem.removeInstance(form._myitem.count- 1);

xfa.form.recalculate(1);