Choose Your Section Wisely - Greg Collins
in

InfoPath Dev

This Blog

Syndication

Greg Collins

Choose Your Section Wisely

I uncovered this problem on 2004-08-18 while hard at work creating a form. It caused me quite a headache at first until I was able to narrow and then finally track down the problem. I've reported it to Microsoft.

DESCRIPTION:

The problem seems to stem from inserting a non-repeating group into the view that is contained within repeating group, which is not inserted into the view. The non-repeating group is inserted as a non-repeating Section.

Here's the walkthrough to reproduce the problem:

  1. Launch InfoPath.
  2. Create a new blank form
  3. Open the Controls task pane.
  4. Insert a Repeating Section in the view.
  5. Insert a Section in the Repeating Section.
  6. Insert a Text Box in the Section.
  7. Select everything in the view and delete it.
  8. Open the Data Source task pane, and then expand the data source tree.
  9. Insert group2 as a Repeating Table in the Section.
  10. Insert group1 as a Section at the bottom of the view. This section would ultimately have conditional visibility added to it.
  11. Click inside the Section to set the insertion point.
  12. Right-click on group2 and then choose More | Section (i.e. non-repeating section)
  13. Drag and drop field1 into the group2 Section.
  14. Preview the form.

    Note that when clicking on the Section that it gets highlighted blue just as the Repeating Table does. We need to eliminate this blue highlighting.

  15. Close the preview.
  16. Delete the group2 Section.
  17. Click inside the Section to set the insertion point.
  18. Right-click on group3 and then choose More | Section (i.e. non-repeating section)
  19. Drag and drop field1 into the group3 Section.
  20. Preview the form.

    Note that when clicking on the Section that it no longer gets the blue highlighting. This worked!

  21. Close the preview.
  22. Choose Extract Form Files from the File menu, choose a folder and then save.
  23. Close InfoPath.
  24. Open the folder you extracted the form files to.
  25. Right-click on the manifest.xsf file and choose Design.

    An error message appears with the following message:

    InfoPath cannot open the following form: {Folder_Path}\manifest.xsf
    Microsoft Office InfoPath cannot open the selected form.


  26. Click OK, and exit InfoPath.
  27. Edit the view1.xsl file in a text editor, such as NotePad.
  28. Search for [1]. You'll find the following line:

    <xsl:apply-templates select="my:group2[1]/my:group3" mode="_13"/>


    Note that the [1] means to select the first instance of group2. This indicates that we chose a non-repeating section when we inserted group3 in the view.

  29. Delete [1], save and then close the view1.xsl file.
  30. Right-click on the manifest.xsf file and choose Design.

    InfoPath opens the form template, but now there are red errors on the group3 Section and on field1.

When we used a non-repeating Section using group2, it worked, but we had the blue highlighting. The apply-templates in the view for that scenario looked like this:

<xsl:apply-templates select="my:group2[1]" mode="_12"/>

So why does InfoPath work when selecting only the first instance of a group, but not when selecting a field within that first instance? Why can you preview the form, but once you save it, you can no longer open it?

WORKAROUNDS:

I currently do not know of a workaround for this.

©2004 Greg Collins. All rights reserved. Licensed to Autonomy Systems, LLC for display on InfoPathDev.com.

Comments

No Comments
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.