KJS1192
KJS1192

Reputation: 103

Hide a region on initial page load, show after button is clicked

I am setting up a report on a page with multiple checkbox page items and start and end date page items. The user clicks a 'Run Report' button to generate a report region below on the page.

The default selections for the checkbox items are all items selected, and the Start and End Date items have default options based SQL queries.

I want to the report region to hide on the initial page load, and then show once the user clicks 'Run Report'. I tried the following solutions:

  1. Set region condition to 'Never' and then use a dynamic action to show the region once the button is clicked. However, I think the 'Never' condition trumps the dynamic action.
  2. Create two dynamic actions, one on page load to hide the region and on clicking the button to show the region. However, the show DA is always overwritten once the page loads again because of the first hide dynamic action, so the region never displays.

Has anyone else run into this problem? Any solutions? Thank you!

Upvotes: 2

Views: 5133

Answers (1)

Scott
Scott

Reputation: 5055

You may like to consider the 'lazy loading' described on Maxime's blog. https://askmax.blog/2018/05/18/lazy-loading-report/

Like you said, a server side condition will trump and DAs that are showing/hiding on the browser, as the region would never render.

If you want to hide something on entry, you can do something similar to what you described, but I'm not quite sure what you've done.

  1. on load dynamic action to hide region (or add style="display:none;" to custom attributes of region.)
  2. on click of your button, show the region (do not run on initialisation), and refresh the region.

Upvotes: 2

Related Questions