Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Button in Master page


Former Community Member
Hi All,

I have 2 buttons in MASTER PAGE, upon clicking first button , the second button should be hidden. This works fine only for the first BODY PAGE and for rest of the BODY PAGES the second button is still visible. How to make button invisible in all the BODY PAGES?


3 Replies


Level 3


Yes, I am having exactly the same problem. I have buttons for PRINT, SAVE AS, LOCK, and RESET. If the user clicks LOCK, then I want the RESET button to go away...and it does...but only on the first page.

I only have one Master Page. My code for making RESET disappear is: ResetButton1.presence = "invisible";

I also tried it with the "absolute SOM" which has the "pageset" code, but it still does not work.

Thanks to anyone who can answer this.



Level 10

You can find the current page number in the code and then if it is not first page, then hide the controls..


this) >1){

     //Write code to hide all your controls in the second page onwards.


Place the code in the Layout Ready event of any control in the Master Page.