Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

addInstance with hidden form

Not applicable
I have a form (FormHidden) that is a hidden form when the pdf loads. I have a checkbox that can be checked to make the form visible. The code on this checkbox is:

if (this.rawValue == "1"){

xfa.form.form1.MainPage.FormHidden.presence = "visible";

} else {

xfa.form.form1.MainPage.FormHidden.presence = "hidden";


Once this checkbox is checked the FormHidden appears with the various text entries. I then have another button called Add Source that is supposed to add another instance of the FormHidden form. The code for this button is:



The problem I am having is that when I push the button if I have the form hidden initially it will not add another instance of the FormHidden. The Add Source button works fine if I make the form visible to begin with. It is something to do with having it hidden at first that makes it so it will not generate another instance. Any help would be wonderful. Thanks in advance!
3 Replies
Level 2
Level 2
By design: instanceManager.addInstance(1); adds the original state of that component!


The reason is that the new instance is also hidden - Make it visible!
Not applicable
Thank you for your response Luigi. If Luigi or anyone else has any ideas on how I can make these subsequent instances of the subform visible while still leaving the first one hidden until the button is clicked that would be great. I am not sure what the code would be for something like that. Do I need to be using other than the addinstance to be able to do this? Thanks!
Level 10
Level 10
The issue is that when the subform is hidden it is not part of the layout and as such is not an addressable object. When you call the instanceManager there is no object there. To alleviate this we added a syntax of _subformName that will address objects that are not part of the layout. So try this syntax instead.


Note that you do not need the xfa.resolveNode syntax in these expressions.