I am designing an XDP form that uses mostly fragments developed for another form. The fragments were created by an Adobe consultant so I have to imagine they are constructed correctly. I have had this same issue in the past with fragments I too have created.
The problem is, when I drop the fragments onto my form in Design View, they rearrange themselves. As a header for each fragment, a text field with no caption is used (just to show text in a box). For some reason when all of the fragments rearrange themselves, everything stays in the correct order, EXCEPT the header field gets moved to the bottom of the fragment. If you open the fragment to edit it, however, everything appears fine. I checked the order in the hierarchy and it is also correct. The weirdest part is, when you view the form the fragments were originally created for, only one of them does this. The rest appear fine.
Could this be some kind of bug? Has anyone had this problem? If so, what did you do to fix it?
This is was a known bug in LiveCycle Designer ES (8.1) that was fixed in Designer 8.2 (now released).
The only workaround I know of is to manually edit the XML Source and specify all first-level nodes that appear in the referenced fragment in the order they should appear (basically, in the order they're defined in the referenced fragment). After doing that, the fragment should behave correctly from the referencing form. Just make sure you don't edit any of the properties on the objects inside the fragment subform from the referencing document.