Binding Sections with no Data - best practice? - InfoPath Dev
in

InfoPath Dev

Binding Sections with no Data - best practice?

Last post 06-07-2016 12:46 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-07-2016 08:38 AM

    Binding Sections with no Data - best practice?

    I often use sections with 'Hide this control' formatting rules to show/hide different buttons or messages on forms (for a SharePoint 2010 Form Library).

    When these sections contain no actual data fields, what do you consider best practice for binding?

    Design Checker doesn't like them to be unbound, although I'm not sure this has any consequences.

    I have variously:

    • Created a single empty group called "NoDataSectionBinding" to bind all data-free sections to (this still upsets the Design Checker with a 'Control stores duplicate data' warning if more than one in the same view)
    • Tried to bind data-free sections to a group with the fields that the formatting rules are primarily based on (that group often displayed in the same view though, also causing 'duplicate data' warning)
    • Created numerous empty groups so as to bind each data-free section to its own (no obvious downside, just seems OTT if there are more than a few - and bumps up the size of individual .xml form files with empty tags)

    Would be nice to decide on a consistent approach.

  • 06-07-2016 12:46 PM In reply to

    Re: Binding Sections with no Data - best practice?

     I usually happily ignore "duplicate data" warnings. If a control can be hidden without being in a section, I will hide it. If I have a group of controls or fields I need to hide, I usually take that as an indication that my schema should also have a group - like, if I need to hide Name / Address / City etc unless a checkbox is selected, I'd have a group in my schema called "Contact" with the various fields in it, and my section would be bound to Contact.

    If I need to just hide a control that can't be hidden via formatting, but only disabled, I'll bind the section to the same group as the field.

    If I have some stuff completely unrelated to my main data source that I want to have in a section, I'll use a secondary XML file (as a resource in the form) and  I will bind sections to groups in that file - say for a "help" section or something.

    The one thing I just won't do is your last bullet - I like my schema to represent my data, and feel like a bunch of empty groups is at odds with that goal.

     Wonderful post, by the way, I hope others will also join in! 

    Hilary Stoupa

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