Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Hide only search resulted pdf pages when search results need to reset

Avatar

Level 2

Hi All,

I have one dynamic xml form pdf, when open this pdf doc, only one page will be visible in that page i have some search functionality. Once i do some search on this page depending upon search it unhides those pages(Which are satisfied search condition). In each search result page i will have one button 'Back To Main Page', when user click's on button the search results should be reset(Need to hide all unhidden page and focus should come to search page).

Actually i successed this functionality but here when user click on 'Back To Main Page' button ,i am hidding all pages in pdf doc. Here i need to hide only the pages which are unhidden not all the pages in pdf. My code snippet as follow (Suppose pdf doc has 8 pages)

topmostSubform.Page1.presence = "hidden";
topmostSubform.Page2.presence = "hidden";
topmostSubform.Page3.presence = "hidden";
topmostSubform.Page4.presence = "hidden";
topmostSubform.Page5.presence = "hidden";
topmostSubform.Page6.presence = "hidden";
topmostSubform.Page7.presence = "hidden";
topmostSubform.Page8.presence = "hidden";

How can i achive to hide only search resulted pages. Because if i have 500 pages in pdf doc i need to write hide for each page.I need to avoid this.

Advance Thanks

Prasad Sagala

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Prasad,

Since you have got the search criteria to make the required pages visible, I would set up a global variable (in the File / Form Properties / Variables Tab) and then have the search script put the search criteria into the global variable (when accessing the global variable you only need .value, instead of .rawValue).

When setting the global variable you will need to give it a name and an initial value "0".

Then the "go to search page" button would include script to hide the page references in the gobal variable.

Good luck,

Niall

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi Prasad,

Since you have got the search criteria to make the required pages visible, I would set up a global variable (in the File / Form Properties / Variables Tab) and then have the search script put the search criteria into the global variable (when accessing the global variable you only need .value, instead of .rawValue).

When setting the global variable you will need to give it a name and an initial value "0".

Then the "go to search page" button would include script to hide the page references in the gobal variable.

Good luck,

Niall