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