Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Presence script stops working

Avatar

Level 3

Hello,

I have a multi-page dynamic PDF. Page 1 has a menu that allows you to hide the pages you do not want. There is a button to hide this menu. When the form opens the button works perfectly. However if I scroll to page 9 and use another button to add additional pages suddenly the button that only controls presence stops working completely.

The code (on mouse up) on the button on page 1 is:

if(employees.Page1.HideMenu.presence == "visible"){
    employees.Page1.HideMenu.presence = "hidden";
}
else {
    employees.Page1.HideMenu.presence = "visible";
}

(I tried a case statement also but the same thing happens).

The button that seems to break it has this code:
_InspireGroup.addInstance(1);

xfa.form.recalculate(1);
xfa.host.pageDown();

app.alert("You have jumped to the newly added Project Example page");

I can't figure out what the code on page 9 has to do with the code on page 1.

Can anyone help?

1 Reply

Avatar

Level 10

Hi,

The only thing I can think is that the addInstance is adding a continuation of Page1, so that there is now Page1[0] and Page1[1], so that the script doesn't know which Page1 is referenced in the script.

Try the javascript console to see if that is throwing up errors. Also maybe script out some of the lines in the addInstance script to see if that is cause the conflict, like the recalculate.

Otherwise would need to see a version of the form to see what is going on with the structure.

Good luck,

Niall