Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

display value in footer on only last page:

Avatar

Former Community Member

I have the same footer on 3 of my master pages. Depending on data, my form may grow to several pages.

The first 2 master pages display exactly once and the third page grows to no. of pages depending on input data.

Is it possible to script some event so that the textfield on footer displays only on last page?

I have seen examples of xfa.layout.pageCount() and xfa.layout.page(this), and tried the conditions on if last page =  currentpage, show/hide  the value of text field in the footer.

If there are 10 pages, system should display the text value in the footer only in the 10th page. If the form got only 2 pages, it should display only on second page.

I tired all kinds of scripting with pagecount and page(this). But the script is effecting all the pages irrespective of first/ last page.

I will be greatful if you can put the sample code/ form on how to do this.

Thanks,

Krishna

2 Replies

Avatar

Former Community Member

You will have to test to see if the current page is the last page or not. You can get the currentpage that the object is on by using xfa.layout.page(this) and you can get the number of pages in your doc by using xfa.layout.pageCount(). Now on the docReady event of the object you coudl use this javascript:

if (xfa.layout.page(this) == xfa.layout.pageCount()){

     perform form logic here

}

Hope that helps

Paul

Avatar

Former Community Member

Hi Paul,

   Thank you for the logic.

Actually I tried this.

I have some fields in the 3 footers which got some explicit binding. If I put some value in the first page footer in this field, and if the logic (current page != no.of pages) , the value is getting reflected in all pages without checking for further pages.

I figured out what the actual problem is. It's not with page logic. But with the externally binded fields. If we put the calculated field for one footer, the form will keep the same value without taking from external binded xml. I tried it in a alternate way by getting these values using calculated fields and that worked for me.

Krishna