Expand my Community achievements bar.

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

Make visible a field when deleting a page in Livecycle

Avatar

Level 3

Hi everybody

When I add a page, the footer of the last page is automatically deleted. It works perfectly. But I would like that the footer appears again on the last page when I delete the current page.

Here is the code used  with the initialize event :

for (var i = 0 ; i < xfa.resolveNode("ira._Page1").count; i++)

{

          if (i < xfa.resolveNode("ira._Page1").count - 1)

{

                    xfa.resolveNode("ira.Page1[" + i.toString() + "].Footer").presence = "hidden";

}

else

{

                    xfa.resolveNode("ira.Page1[" + i.toString() + "].Footer").presence = "visible";

}

}

this one used with click event for adding a page :

_Page1.addInstance();

xfa.host.pageDown();

app.execMenuItem("FitPage");

and at least for deleting a page

this.parent.parent._Page1.removeInstance(this.parent.index);

this.parent.parent._Carte.removeInstance();

Thanks for advance for your help.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi phil,

You need to remember, each time you remove instances you always have to remove it at last in your code. Because if you delete the subform or page where is the code running well the code doesn't exist anymore.

So you must make sure to do everything else with other objects before removing the instance of its parent.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi phil,

You need to remember, each time you remove instances you always have to remove it at last in your code. Because if you delete the subform or page where is the code running well the code doesn't exist anymore.

So you must make sure to do everything else with other objects before removing the instance of its parent.

Avatar

Level 3

Thanks Magus, I am going to try to cop with.

This is done by moving the code from initialize event to the "plus" button with the validate event.