I have a form with three tables. Users are able to make these tables appear and disappear on a click event. They are also able to add rows to these tables again on a click event.
Because of the two possibilities below, this form will at times spread to a second page.
The overseer of our forms development project would like to be able to notify the user when the page expands on to the second page.
Can anyone tell me how to generate a message box only in the event that a second page is generated?
Thanks in advance!
could you please check if this works?
On the form calculate event add the follwowing script:
var pCount = xfa.layout.pageCount();
app.alert("New Page Inserted/Generated");
It did work, but for some reason it's firing twice? i.e. the message box appears twice when it should only appear once
I think it must be something to do with where I have the code? Below is where I have it.
Also, once it's fired it keeps firing with every button that is pressed.
In reality the form would only ever be a maximum of 2 pages but when I change the code to if(pCount = 2) the code fires as soon as the form opens and on every click after that.
Is there some tweaking that we can do with it?
Thanks for your help!
You could use a global variable like boolMessageFired set to 0. Check the value before entering the calculate event, if it is 0, enter the event then set it to 1 before exiting the event. If it is 1, write code to exit the event so the code won't execute. The next time you enter the event, the code should be bypassed and the message box will be suppressed.