Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Show/hide cover letter from button click

Avatar

Level 3

Hello;

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?

coverletter-heirarchy.png

Thanks

3 Replies

Avatar

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.

ie:

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

Avatar

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

Avatar

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.

XFAObject.sfLetter1:3:XFA:topmostSubform[0]:Page1[0]:sfBasicInfo[0]:AddCoverLetter[0]:click

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