Expand my Community achievements bar.

adding subform instances within subform instances

Avatar

Level 4

In this form (attached), the user chooses a type of page to add by clicking the buttons pagebtn, discussion, assessment, or dropbox. When they click this button, an instance of SBtemplate.Pages is created, but only the subform they requested (page, discussion, dropbox, assessment) appears. So, while the user only sees the page type they requested, they are actually seeing a subform within another subform.

The problem I am having now is that I can't create instances of subforms within these. For example, in the page subform, I need users to be able to create instances of the image, audio, and video subforms. And in the discussion subform, I need the user to be able to create an instance of the customrubric subform. I think this is not working because I need to specify the instance of SBtemplate.Pages in the code calling the instance manager.

Is this a correct assessment? If so, how do I do that? If not, what can I do to accomplish this action?

Thank you!

1 Reply

Avatar

Level 4

I figured this out, so I wanted to post my form in case anyone is having the same problem.

This is an example of a click event within one of my subforms to create an instance of another subform:

xfa.resolveNode("xfa.form.SBtemplate.Pages[" + (this.parent.parent.parent.index) + "]").page._image.addInstance(this.parent.index);