XPath based default values and repeating sections - InfoPath Dev
in

InfoPath Dev

XPath based default values and repeating sections

Last post 06-25-2007 09:29 AM by Greg Collins. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-20-2007 01:02 PM

    XPath based default values and repeating sections

    I have a form with a complex repeating section.  There are three sets of default values that the section can have.  I created three different sections in the data tab of the repeating section.  I modified the defaults for each section.  I noticed if the default was plain text, each section maintained its unique default.  If the default was based on an XPath expression to retrieve data from another field, the default would "bleed" over into the other sections.  This happened whether the "affect all" or "affect only this section" radio button was selected.  I made a simple test form and the same thing occurred.

    Is this a known issue or accepted limitation?  Most of the default values will be derived from other fields.

     Help would be much appreciated (Last major issue on a year long project!)

     Cheers,

     Ren

  • 06-21-2007 09:40 AM In reply to

    Re: XPath based default values and repeating sections

    I have confirmed your issue. Unfortunately this appears to be by-design for InfoPath. I believe it is a limitation of the way the inserting works by pulling unique fragments from the manifest.xsf file. Text values are simply embedded into the manifest fragment to be inserted, however, the expression is added as a default value formula for the field itself (not so with string values).

    My gut instinct is that there is no direct workaround for this using the method you are using. I tried adding a rule to the field that is supplied the string value to set a different xpath expression based on the string, but inserting the new row didn't automatically run the rules. Therefore this method doesn't work.

    However, you can probably use code to accomplish this. Code would be able to determine when a new row is inserted and do the right thing.

    Good luck.

  • 06-21-2007 10:47 AM In reply to

    Re: XPath based default values and repeating sections

    Greg,

    Thank you for the explination.  I gives insight as to how InfoPath works, and you gave me an idea to use rules:

     I have found a 90% workaround.   A 3 section choice group is what determines which of the three sets of values should be used.  I have made a set of rules tied to the repeating group with conditions to test the presence of the choice sections.  This works except the first row would not be poplated (is this the same problem you had?).

    Ren

  • 06-25-2007 09:29 AM In reply to

    Re: XPath based default values and repeating sections

    If that is the only remaining problem, you should just go into the Tools | Default Values menu and tell the form to not have a default first row. Then the users will just have to insert the row, which should in theory solve your last issue.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.