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.

Show/hide cover letter from button click


Level 3


My client is looking for a solution where, say on a page of a form, they can click on a button to "add a cover letter" to the form that would then become a first page. I had done this before (via a simple show/hide subform) but I'm seeing now that the version I created essentially was a static/non-expanding page that I had added to a flowable form (no subforms on that specific pages hierarchy).

Going back and forth from that other form that I did a while ago, I haven't been able to replicate that functionality on this new form for some reason. I have master pages working on this new version for the flowable content and when the button to hide the cover letter is clicked, it looks like the subform for the cover letter is only hidden, not the entire page. What am I missing? If you have a form that uses master pages, how would you effectively hide a page along with it's master page?

There's also the assumption that my client will probably request that the new cover letter allow for expandable text fields. Is this possible? I'm not sure why this recent form isn't working like the last one did. What could I be missing?



3 Replies


Level 7

Are you using resolveNode? I find sometimes when i am having trouble I do that and it works. I have never need to hide a master page, it should be attached to the page itself. Check your references.


this.resolveNode("topmostSubform.CoverLetter").presence = "hidden";


Level 3

Thanks for the suggestion, MinusZero​;

I tried using resolveNode but it seems it's still happening. I've uploaded a version of the form to Drop Box for download. Can you take a look at it and tell me what I might be doing wrong?

I really appreciate it.

Link: https://www.dropbox.com/s/6isbescajtzqa7q/coverletter_121718.pdf?dl=0


Level 7

I had a look. I have had this problem as well and never found a solution. It seems like a limitation of XFA forms.

I found this: There is a restriction in XFA that the 1st Master page definition must be used. Any subsequent ones can be unised ...but the 1st one must be used!

Hide first Master Page

A further thought: When i clicked the Add Cover Letter button, it threw an error, there is an incorrect reference. I dont think it will help with hiding the page.

GeneralError: Operation failed.


Invalid property get operation; subform doesn't have property 'sfLetter1'