I have a number of optional sections in my form that are, by default, not included in the form's data structure until the user checks a checkbox and the section is included using thisXDocument.View.ExecuteAction( xOptional::insert, <xPath> ). When the user unchecks the checkbox, the group is removed using xOptional::remove.
Note: I'm forced to use conditional presence as the sections contain 'cannot be blank' fields that would otherwise cause the validation to fail if they were merely hidden by conditional formatting.
This works fine if the section to be inserted is in the same view as the checkbox which controls its insertion. However, I have a group which should only appear on an 'approval' view that I only want to include if the user selects a checkbox on the 'request' view.
Using View.ExecuteAction doesn't work as the optional section is on a different view. I can create an empty optional section on the 'request' view that inserts the group, however this is a messy workaround and if I hide it using conditional formatting I can't remove it using xOptional::remove when the user unchecks the option.
Can anyone advise me as to how I can add and remove groups from my XML document using C# code that doesn't use View.Execute action?
I've read that the DOM offers this facility but I'm not at all familiar with it and a brief flirtation resulted a flurry of errors.
I'd really appreciate some help with this query as I'm kinda stuck at the moment...
David.