Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Table Header to have "-Continued" Text on Subsequent Pages

Avatar

Level 2

I have this specific requirement where I need the Table Header to have an additional text that says "Title of the Table - Continued" on the subsequent Pages. How do I achieve this?

Table has one Header Row (Selected the "Include HeaderRow on Subsequent Pages" option and is getting repeated on Subsequent Pages) and a Repeating Body Row which will have values from the DataXML.

So the table will look something like this;

-------------------------------------------------

Desired Result:

Page 1:

Table Title

Body Row 1

Body Row 2

Body Row 3

Page 2:

Table Title - Continued

Body Row 4

Body Row 5

Body Row 6

------------------------------------------------

Achieved Result:

Page 1:

Table Title

Body Row 1

Body Row 2

Body Row 3

Page 2:

Table Title

Body Row 4

Body Row 5

Body Row 6

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

Try putting this JavaScript in the layout:ready event of your header row;

if (this.index > 0)

{

    this.resolveNode("#draw.#value.#text").value = this.parent.resolveNode("HeaderRow.#draw.#value.#text").value + " - Continued";

}

So set the first cell of the header (which I assume is a draw field) to the value of the first cell of the the first header row (which I assume is called HeaderRow) and append the text " - Continued".

If the table grows because of the initial binding and not because of a "add row" button then you could move this code to the docReady event, which wont be called as often.  Code in the layout:ready events can be a problem for performance.

Regards

Bruce

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

Hi,

Try putting this JavaScript in the layout:ready event of your header row;

if (this.index > 0)

{

    this.resolveNode("#draw.#value.#text").value = this.parent.resolveNode("HeaderRow.#draw.#value.#text").value + " - Continued";

}

So set the first cell of the header (which I assume is a draw field) to the value of the first cell of the the first header row (which I assume is called HeaderRow) and append the text " - Continued".

If the table grows because of the initial binding and not because of a "add row" button then you could move this code to the docReady event, which wont be called as often.  Code in the layout:ready events can be a problem for performance.

Regards

Bruce