Highlighted

Unable to move subform when using moveInstance

Avatar

Guest

18-09-2008

Hello. I need help.



I have a four questions wrapped into (DisclosureQuestions) and this is nested in Subform1. I created a button in Subform2 to add these questions. However, when I click the button, it adds the questions right under Subform1. I am trying to move the questions to Subform2. My javascript is below. Can anyone tell me what I am doing wrong?



var oNewInstance = Subform1.DisclosureQuestions.instanceManager.addInstance(1);

var nIndexFrom = oNewInstance.index;

var nIndexTo = Subform2.index + 1;

Subform1.DisclosureQuestions.instanceManager.moveInstance(nIndexFrom, nIndexTo);



Thanks!

Replies

Highlighted

_SekharN_

19-09-2008

some times just xfa.form.recalculate(1); will do it for you...try them individually and together to see which one works best. Remember any time you use relayout() that should be the last exicuting line of code in that script.
Highlighted

Avatar

Guest

19-09-2008

Dear Sekhar,



Thanks for the suggestions. I tried it with relayout, recalculate and with both and it still doesn't work.



do you have any other ideas?



thanks!



-ambero