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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Moving subform instances to another subform

Avatar

Not applicable
Hello. I need help!



Is it possible to move a subform instance to another subform?



I have created a form. Page 3 is a flowed subform. I have 4 subforms on Page 3. All are repeatable and flowed. I have named these subforms A, B, C, and D.



I have created a button in SubformD in order to insert an instance of SubformA. I want to move that instance below SubformD.



My script is below. Am I doing this right? I feel that fundamentally I have missed a key function/method.



var oNewInstance = Page3.SubformA.instanceManager.insertInstance(1);

var nIndexFrom = oNewInstance.index;

var nIndexTo = Page3.SubformD.index + 1;

Page3.SubformA.instanceManager.moveInstance(nInedx From, nIndexTo);

xfa.form.recalculate(1);



I have also tried:



var oNewInstance = Page3.SubformA.instanceManager.insertInstance(1);

var nIndexFrom = oNewInstance.index;

var nIndexTo = this.parent.index + 1;

Page3.SubformA.instanceManager.moveInstance(nInedx From, nIndexTo);

xfa.form.recalculate(1);



Thank you so much for your help!



-AmberO
1 Reply

Avatar

Not applicable

Hi Amber - i have asked a very similar question just recently - did

you ever find a solution to this problem?

How do you transfer a table row (instance) from table1 to table2??

Regards David