Unable to move subform when using moveInstance

Avatar

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

Avatar

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct reply

0 solutions
View profile

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct reply

0 solutions
View profile
_SekharN_
Level 5

19-09-2008

try adding xfa.layout.relayout(); at the end of the script and let us know the results.

Avatar

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct reply

0 solutions
View profile

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct reply

0 solutions
View profile
_SekharN_
Level 5

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.

Avatar

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