On the first part of my form are buttons, user picks either button and the proper form is displayed. The first page is hidden. After that they need to import data using: xfa.host.importData(""); The system browser lets them select the XML file. When the data is merged the file rerenders and the first page is visible again. How can I fix this.
If you have script in the initialize event to set up the pges (visible/hidden), consider moving this to the docReady event, which fires only once.
Otherwise include script to display the appropriate pages, AFTER the import XML line.
I do not have a script on the initialize event. I have a click event that is triggered by the user. The buttons on the cover page work fine. The problem occurs when I use xfa.host.importData(""); on a click event. The state of the form is reset to the way it opened and the cover page is visible again.
I see the problem now. As you say, it appears that the form layout is redone after the data merge. I not sure if you can stop this. I have tried a few options for rehiding the relevant pages again, using flags, etc, but can't get that to work.
If I come up with anything I will post here.
Thanks. I appreciate the help. I was able to sort of fix it by resetting the form in the Initialize event. I have an if statement that checks some things after data is loaded then sets the form based on that. Its a bit klugy though.