Hi All
I'm sorry, I feel like I'm asking a very basic question.
But still struggling understanding the "current page number" concept.
How can I detect the current page number when scripting in 'Main' subform element?
So, not in the MasterPage, but when populating the MastePage with a real content.
For example when printing list of products, I'm using a dataset (let's say 50 products)
and "Repeat subform for Each Data Item" checkbox in order to loop over product list and print each.
Let's say I wan't to add a JS inside the Product sub-subform that would detect the page number
and apply presence=hidden for a page element only when on 1st page.
Something like:
if( currentPage == '1' ){
this.presence='hidden';
}
When working with MasterPages I do the below trick, and it works totally fine (retutns 1, 2, 3 ... n)
this.rawValue = xfa.layout.page(this);
But when trying to use the same xfa.layout.page(this) in Main area I get the result of -1 (minus one) on each page
Then how can I detect the current page number inside my hypothetical Product subform?
Tried to follo radzmar's code snippet but ... the result is exactly the same
getting correct numbering on MasterPages (1, 2, 3 ... n) but -1 inside Main
this.rawValue = xfa.layout.pageContent( xfa.layout.absPage(this).toString(), "pageArea", true).item(0).index + 1;
https://experienceleaguecommunities.adobe.com/t5/adobe-livecycle-questions/get-current-master-page-n...
PS. Adding scripts in the initialize* event, tried ready event as well but no difference.
Any comment appreciated.
bob