Expand my Community achievements bar.

render a blank page if the form ends with odd pages

Avatar

Level 2

Hi,

i am designing a form in Livecycle es4 designer, the form is saved as .xdp and we have a .xml as input, based on the data stream the form extends to n number of pages, i need to end my form on an even page always,

if there are 3 pages based on the data, i need to show an blank page as the  4th page. if there are 4 pages based on data stream we need not show the extra blank page.

i have added a blank page in my designer made it hidden from layout, , wrapped in a sub form  and in the layout editor :ready i have written the following script

var pageCount = xfa.layout.pageCount();

if(pageCount%2==0){Blank.presence = "hidden";}

{Blank.presence = "visible";}

but my form now which is 3 pages does not append the blank page, any direction will be very helpful.

Thanks in advance

CW

1 Reply

Avatar

Level 7

I realize this is an older post. So, if you've already figured this out, ignore my reply.

Is there a typo (omission) in your code? I don't see an "else" clause.

I would expect it to look like this:


var pageCount = xfa.layout.pageCount();


if (pageCount%2 == 0) Blank.presence = "hidden";


else Blank.presence = "visible";


This code worked for me when I entered it into the form1::ready:layout event.