Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

How to check number of rows in my table on First page?

Avatar

Level 2

Dear Adobe Experts,

As you can see below i am showing header row in both intial page and subsequent pages. But sometimes the area is not sufficient to show the item on first page

1762044_pastedImage_0.png

Like this

1762045_pastedImage_1.png

How can I achieve this!

BR

Dhruvin

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Dhruvin,

Try this code in the docReady event of the form root (the top most) object

if (xfa.layout.page(xfa.form.form1.Table1.resolveNode("Row1[0]")) != xfa.layout.page(xfa.form.form1.Table1.resolveNode("HeaderRow[0]"))) {

xfa.form.form1.Table1.resolveNode("HeaderRow[0]").presence = "hidden";

}

This will test if the first header is on a different page than the first row then make the first header hidden.

Regards

Bruce

View solution in original post

4 Replies

Avatar

Correct answer by
Level 10

Hi Dhruvin,

Try this code in the docReady event of the form root (the top most) object

if (xfa.layout.page(xfa.form.form1.Table1.resolveNode("Row1[0]")) != xfa.layout.page(xfa.form.form1.Table1.resolveNode("HeaderRow[0]"))) {

xfa.form.form1.Table1.resolveNode("HeaderRow[0]").presence = "hidden";

}

This will test if the first header is on a different page than the first row then make the first header hidden.

Regards

Bruce

Avatar

Level 2

looks promising let me try that

Avatar

Level 2

Hi Bruce,

It worked like a charm! Thanks a lot for your inputs!

Below piece of Code with Hierarchy!

if (xfa.layout.page(xfa.form.FormQuoteNotification.bdyMain.frmTableBlock.tblTable.resolveNode("rowTableItem[0]")) != xfa.layout.page(xfa.form.FormQuoteNotification.bdyMain.frmTableBlock.tblTable.resolveNode("hdrTableHeader[0]")))

{

xfa.form.FormQuoteNotification.bdyMain.frmTableBlock.tblTable.resolveNode("hdrTableHeader[0]").presence = "hidden";

}

1764543_pastedImage_0.png

How can i access on page 1 , rowTableItem0 is on page 1 or not?

Avatar

Level 10

Hi Dhruvinm,

The xfa.layout.page() will give you the page an object is on, the only trick is that you have to wait for the page to be laid out, so events like the initialize are too early. docReady seems ok otherwise try layout:ready but that get called a lot of times, so you may need other code to allow for that if it starts to have some impact.

Bruce