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

Conditional object presence depending on pagination

Avatar

Level 2

I have a non-interactive form that has 3 master pages.

The pagination of page 1 occurs dynamically depending on the data content. Page 2 is fixed and page 3 can be displayed according to some conditions.

I need to condition the presence of a table on the last page of page 1.

How can I do this using JavaScript?

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi @robson1976, your description is a bit abstract Let's see if I get the gist of it...

When you say Page 1,2,3 do you mean the master-pages or are you talking about page subforms?

If we talk page subforms, then page 1 would be be set as Content: Flowed, Top to Bottom and the table would paginate "Continue Filling Parent". In this scenario your table would be placed as the last object in the flow of your first page subform and receive Pagination Top of Next Page - hence it would always start on the last page of the flowed content.

If you need that table to show or not show depending on logic/data then as Mayank says you would use this.presence = "hidden"

The same if your 3rd page should only show under certain conditions you would have this.presence = "hidden" in the initialize script of the subform.

Kosta_Prokopiu1_0-1620156678220.png

Kosta_Prokopiu1_1-1620156738121.png

Kosta_Prokopiu1_2-1620156823061.png

All visible

Kosta_Prokopiu1_3-1620156907855.png

All optional parts hidden with this.presence = "hidden"

Kosta_Prokopiu1_4-1620156966609.png

 

View solution in original post

4 Replies

Avatar

Correct answer by
Employee

Hi @robson1976, your description is a bit abstract Let's see if I get the gist of it...

When you say Page 1,2,3 do you mean the master-pages or are you talking about page subforms?

If we talk page subforms, then page 1 would be be set as Content: Flowed, Top to Bottom and the table would paginate "Continue Filling Parent". In this scenario your table would be placed as the last object in the flow of your first page subform and receive Pagination Top of Next Page - hence it would always start on the last page of the flowed content.

If you need that table to show or not show depending on logic/data then as Mayank says you would use this.presence = "hidden"

The same if your 3rd page should only show under certain conditions you would have this.presence = "hidden" in the initialize script of the subform.

Kosta_Prokopiu1_0-1620156678220.png

Kosta_Prokopiu1_1-1620156738121.png

Kosta_Prokopiu1_2-1620156823061.png

All visible

Kosta_Prokopiu1_3-1620156907855.png

All optional parts hidden with this.presence = "hidden"

Kosta_Prokopiu1_4-1620156966609.png