I need a new instance of this subform:
assessment.Page3.Standards.Standardsdetail
to be created when this button is clicked:
assessment.Page3.addanotherstandard.Button1
I tried this code on the button:
xfa.form.assessment.Page3.Standards.Standardsdetail.addInstance(
true);
but it doesn't work.
I'm a newbie and I'm trying to learn how to do all this as I go with the help of the book Creating Dynamic Forms with Adobe LiveCycle Designer, but I can't seem to figure this one out.
Solved! Go to Solution.
Views
Replies
Total Likes
On the subform that is supposed to be repeating you have to indicate that you will allow more than one. Click on the subform in the hierarchy, then on the Object/Binding tab click the checkbox that says Repeat Subform for Each Data Item.
Paul
Views
Replies
Total Likes
You need to reference the instance manager for "Standardsdetail" either explicitly
xfa.form.assessment.Page3.Standards.Standardsdetail.instanceManager.addInstance(1);
or using the underscore syntax
xfa.form.assessment.Page3.Standards._Standardsdetail.addInstance(1);
where _Standardsdetail is short for Standardsdetail.instanceManager.
Thank you for your quick reply. Do I need to create an instance manager somewhere, or is that built in? How do I do that?
Views
Replies
Total Likes
the Instance Manager is a built in property (method/function?) of any object or subform in the form.
It's pretty cool because you can also then get details like [whatever thing is repeating].instanceManager.count to get the total number you have spawned.
Be forwarned though, if at any point you have Zero instances of the subform, the non-underscore referencing will fail. If that is a possible situation, just use the underscore syntax to directly reference the instance manager, without having to look at any specific instance.
I tried this both ways, and it's still not working. I'm sure I'm missing something really basic and easy. I attached my project. I have changed the way some of the subforms are wrapped since my original post, so the names and heirarchy are a little different.
Thanks again for your help.
Views
Replies
Total Likes
On the subform that is supposed to be repeating you have to indicate that you will allow more than one. Click on the subform in the hierarchy, then on the Object/Binding tab click the checkbox that says Repeat Subform for Each Data Item.
Paul
Views
Replies
Total Likes
Awesome!! It worked! I knew it was something simple like that.
Thank you so very much!
Can you possibly help with the other question I posted today about hiding everything but what the user is looking at to reduce render times?
Views
Replies
Total Likes
ahh, Paul beat me to it.
it's parent subform needs to be set to Flowed content, which you have,
and the subform in question needs to be set to allow it to repeat, as he said.
Views
Replies
Total Likes
Views
Likes
Replies