How to show/hide button depending upon the panel. | Community
Skip to main content
sesmic
Level 4
September 8, 2022
Solved

How to show/hide button depending upon the panel.

  • September 8, 2022
  • 1 reply
  • 1684 views

Hi!
I'm new to AEM forms & working on one where I have 3-4 different panels/tabs. I want to show my submit button in last tab only & hide it in rest panels. 
So can you please tell me how can I achieve this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MorisMonk

Try this in the Submit - Navigation rule:

this.visible = !this.panel.navigationContext.hasNextItem;

With the "Hide Object" property of the button checked, so it is hidden when form opens.

1 reply

Pulkit_Jain_
Adobe Employee
Adobe Employee
September 8, 2022

@sesmic 

You can keep the submit button disabled/hidden in the toolbar, and for the last panel, on initialize/show, you can show /enable the Submit button.

Let me know if you're stuck anywhere.

sesmic
sesmicAuthor
Level 4
September 8, 2022

Thanks for the reply!
But how can I keep the submit button hidden in toolbar? There are other button also (reset, next)
As for the panel only initialize is there. "When initialize Panel & then hide/disable Submit button" is set, button is shown as well as disabled in every panel. Can't figure it out.

MorisMonkAccepted solution
Level 4
September 13, 2022

Try this in the Submit - Navigation rule:

this.visible = !this.panel.navigationContext.hasNextItem;

With the "Hide Object" property of the button checked, so it is hidden when form opens.