Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

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 ?

3 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);