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.

Moving subform instances to another subform

Avatar

Former Community Member
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

Former Community Member

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