Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Creating a table of contents


Not applicable
I was wondering if somebody could help with building a table of contents. The page number functionality is present in the library which I drag and drop onto the master page. Now if I could grab that page number value into a text field on the corresponding page that would be very helpful.

Could somebody please provide me with that script.


3 Replies


Level 10
You shouldl be able to get the page that an object is on by using the;


Not applicable
Thanks Paul.

I tried your script and failed. Here is the scenario: I have a text field called partOne that resides in a subform called part1 which in turn resides in a subform called rfqDetail.

And in my contents page I created a field to capture the page number and the initialize script that I included in it was:

this.rawValue =;

However, all I keep getting is a "-1" value in the text field in the contents page. Any ideas as to what I am doing wrong?

Thanks again for your help.