<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Design Question - Loading content into form with select box</title><link>https://www.infopathdev.com:443/forums/thread/88964.aspx</link><pubDate>Tue, 16 Apr 2013 22:57:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88964</guid><dc:creator>RobSil1976</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88964.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=88964</wfw:commentRss><description>&lt;p&gt;After some further debugging this seems to get even more odd of an issue:&lt;/p&gt;

&lt;p&gt;1. I add a group and a field to my repeating table group.&amp;nbsp; &amp;quot;TestGroup&amp;quot;, &amp;quot;TestField&amp;quot; with a value of blank initially.&amp;nbsp; If I try to add this group/field into my XmlDocument, it will cause theschema validation error to occur.&amp;nbsp; If I wait for that method to complete and my XmlDocument to be attached, then manually browse to each individual row item with an XPath query, I can add the element just fine.&amp;nbsp; &lt;strong&gt;Q. Is there some restriction on how many levels of XmlDocument you can add as a child?&amp;nbsp; I seem to see this error if I have more than 1 level.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;2. If I try to &amp;quot;DeleteSelf&amp;quot; on my containing group, I am unable to re-add the group.&amp;nbsp; In theory I would &amp;quot;DeleteSelf&amp;quot; on my root group and just re-create the entire structure but it constantly fails.&amp;nbsp; &lt;strong&gt;Is there some restriction on adding a group back but it being empty?&amp;nbsp; (I am only adding the empty parent group to start vs. adding in fully structured XML).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Code: 
&lt;pre&gt; mainNav = mainNav.SelectSingleNode(&amp;quot;/my:myFields/my:MyOuterGroup/my:ParentGroupName&amp;quot;, this.NamespaceManager);
                mainNav.DeleteSelf();
                //re-add Prent Group node (now empty).
                doc = new XmlDocument();
                doc.PreserveWhitespace = true;
                group2 = doc.CreateElement(&amp;quot;my:ParentGroupName&amp;quot;, rtc.NamespaceManager.LookupNamespace(&amp;quot;my&amp;quot;));
                doc.AppendChild(group2);
                mainNav.AppendChild(doc.DocumentElement.CreateNavigator());&lt;/pre&gt;</description></item><item><title>Re: Design Question - Loading content into form with select box</title><link>https://www.infopathdev.com:443/forums/thread/88960.aspx</link><pubDate>Tue, 16 Apr 2013 20:36:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88960</guid><dc:creator>RobSil1976</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88960.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=88960</wfw:commentRss><description>&lt;p&gt;No sooner do I try to use nested repeating tables than the error message &amp;quot;Schema validation found non-data type errors.&amp;quot; comes back!&lt;/p&gt;
&lt;p&gt;Is there a way I can see what validation is failing on this error?&amp;nbsp; Even if there is a way I can extract the schema of my main&amp;nbsp;DS and then manualy validate the InnerXML of my objects I am adding in an external tool.. &amp;nbsp; it&amp;#39;s not a very useful message in and of itself. :(&lt;/p&gt;
&lt;p&gt;My only theory it is because i am blowing away the existing items in the child level and then re-adding all new group elements that it fails.&amp;nbsp; &lt;/p&gt;

&lt;p&gt;For example:&amp;nbsp; &lt;/p&gt;

&lt;p&gt;Main:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Fields: StudentName, StudentNum&lt;/p&gt;
&lt;p&gt;Courses -&amp;gt; CourseEntry -&amp;gt; has fields CourseName, CourseID, CourseTeacher (e.g.)&lt;/p&gt;
&lt;p&gt;This works.. I delete every CourseEntry and then re-add new CourseEntries to the Courses group as described above.  But now I am trying to add in a marks group, which has Mark&amp;#39;s Items in it.  Each of these has fields for mark, datereceived, etc.&lt;p&gt;Now the error message is back.&amp;nbsp; Anyone have thoughts on this?&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&amp;nbsp; &lt;/p&gt;&lt;p&gt;I dumped my entire sub-table from my form and just created a &amp;quot;Group&amp;quot; element (TestGroup).&amp;nbsp; I manually add this TestGroup into the form as an empty node:&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XmlNode&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; group2 = doc.CreateElement(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:TestGroup&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, rtc.NamespaceManager.LookupNamespace(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;));&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;
&lt;/font&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;repeatingNode = repeatingNode.AppendChild(group2); //repeatingNode is my Parent repeating row item.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;p&gt;Event when it is 1 group, nothing in it, it fails.&amp;nbsp; What would it be about having a group element that cause it to fail?&amp;nbsp; Also, if i don&amp;#39;t add it, the schema is fine with it missing the group.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Update 2:&lt;/strong&gt;&amp;nbsp; &lt;/p&gt;&lt;p&gt;I have even gone as far as to save my form, then debug it and see my &amp;quot;TestGroup&amp;quot; entry and compare.&lt;/p&gt;&lt;p&gt;In form:&amp;nbsp; &amp;lt;my:TestGroup&amp;gt;&amp;lt;/my:TestGroup&amp;gt;&lt;/p&gt;&lt;p&gt;From Debugging: &amp;lt;my:TestGroup xmlns:my=\&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/myXSD/2013-04-13T21:13:22\"&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2013-04-13T21:13:22\&lt;/a&gt;&amp;quot; /&amp;gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Opening up the form in wordpad, and swapping out the form&amp;#39;s version with the version from debugging and then saving it, and the form still opens.&amp;nbsp; It only ever seems to be when I am programatically setting the value.&lt;/p&gt;&lt;/font&gt;&lt;p&gt;Rob&lt;/p&gt;</description></item><item><title>Re: Design Question - Loading content into form with select box</title><link>https://www.infopathdev.com:443/forums/thread/88939.aspx</link><pubDate>Mon, 15 Apr 2013 20:11:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88939</guid><dc:creator>RobSil1976</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88939.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=88939</wfw:commentRss><description>&lt;p&gt;Managed to get this working.&amp;nbsp; I was trying to appendchild and appendelement using a string and it wasn&amp;#39;t working.&amp;nbsp; I switched over to XmlDocument approach and had a few issues, but managed to get it sorted out.&amp;nbsp; My approach is as follows:&lt;/p&gt;&lt;p&gt;&amp;nbsp;0. Navigate to my repeating table and remove all existing row items via XPath.&lt;/p&gt;&lt;p&gt;1. Get DataConnection of my DB, and manually execute query against it (recursive based upon nested RT).&lt;/p&gt;&lt;p&gt;2. Get result set in DataSource and use XPathNodeIterator to move over each node.&amp;nbsp; My SQL columns are attributes of the node (table).&lt;/p&gt;&lt;p&gt;3. For each iteration I create an XMLDocument and add nodes to this document.&amp;nbsp; Taking great care to check if a value is null and it is one of the key types (int, date, etc.) and apply xsi:nil=&amp;quot;true&amp;quot; attribute.&lt;/p&gt;&lt;p&gt;4. I then SelectSingleNode on the group that contains my RepeatingTable and:&amp;nbsp; &lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;strong&gt;repeatingTblOuterGroup.AppendChild(doc.DocumentElement.CreateNavigator());&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;About to test this with nested Repeating tables (e.g. my courses table, for each row, would have multiple &amp;quot;Marks&amp;quot; nested inside a repeating table).&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;R.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Design Question - Loading content into form with select box</title><link>https://www.infopathdev.com:443/forums/thread/88914.aspx</link><pubDate>Sun, 14 Apr 2013 20:59:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88914</guid><dc:creator>RobSil1976</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88914.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=88914</wfw:commentRss><description>I started trying to accomplish this with code-behind.  I can get my main Student info loading properly by querying the DB and then setting value by parsing out the query results, but this is because I am just setting the value on elements.

As soon as I start dealing with my &amp;quot;Courses&amp;quot; repeating table I keep getting XPath schema validation errors.  If I delete all elements in my repeating table, should I not just be able to execute a command similar to below to append a child element?


  
myNavigator.AppendChildElement(&amp;quot;my&amp;quot;, &amp;quot;test&amp;quot;, myNavigator.NamespaceURI, &amp;quot;testval&amp;quot;);




Thanks,
Robin</description></item><item><title>Re: Design Question - Loading content into form with select box</title><link>https://www.infopathdev.com:443/forums/thread/88913.aspx</link><pubDate>Sat, 13 Apr 2013 21:36:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88913</guid><dc:creator>RobSil1976</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88913.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=88913</wfw:commentRss><description>&lt;p&gt;&amp;quot;then populate my form&amp;#39;s main DS accordingly...&amp;quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Not sure what you mean by this?&amp;nbsp;&amp;nbsp; What I have done is created a field in my main data source &amp;quot;StudentNum&amp;quot;.&amp;nbsp; In theory I type a student num into this field then I will hit the search button and the data is entered into my form.&amp;nbsp; Various fields are editable and I have a save button at the bottom.&amp;nbsp; When I create a DB query, and nest my tables accordingly I see all fields show up in my form but they are in a secondary data source.&amp;nbsp; I am drawing a mental blank on this.. should I copy the data into duplicate fields in my main data source... or just load the 2nd data source fields into my form?&amp;nbsp; Also how do I load the 2nd data source manually, but for just &amp;#39;1&amp;#39; student number?&amp;nbsp;&amp;nbsp; In code-behind I would edit my SQL and insert varibles into my SQL with string concat... not sure using the non-code behind approach what I should be doing?&lt;/p&gt;&lt;p&gt;My form in theory looks like:&lt;/p&gt;&lt;p&gt;Search for Student: [___________________]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Search]&lt;/p&gt;&lt;p&gt;&amp;nbsp;-----------------------------------------------------------------------------------------------&lt;/p&gt;&lt;p&gt;Student Name: _________________________&amp;nbsp; (editable)&lt;/p&gt;&lt;p&gt;Student DOB:&amp;nbsp;&amp;nbsp; _________________________ (editable)&lt;/p&gt;&lt;p&gt;Courses: (repeating table, all fields editable)&lt;/p&gt;&lt;p&gt;Course Name  |  Course Teacher |&amp;nbsp;&amp;nbsp; Student&amp;#39;s Average&lt;/p&gt;&lt;p&gt;rows 1-n, all editable.&lt;/p&gt;&lt;p&gt;[SAVE} [CANCEL]&lt;/p&gt;</description></item><item><title>Re: Design Question - Loading content into form with select box</title><link>https://www.infopathdev.com:443/forums/thread/88905.aspx</link><pubDate>Sat, 13 Apr 2013 14:17:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88905</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88905.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=88905</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;You know - here&amp;#39;s how I decide whether something should go in a main or secondary data source - do I need to maintain this data? In your case, if student ID is a piece of data you need in the form&amp;#39;s data - then use a field in your main DS. If it is not - use a helper 2DS (an XML file as a resource in your form).&lt;/p&gt;&lt;p&gt;I make some exceptions - sometimes, in a repeating group, for simplicity&amp;#39;s sake, I end up adding a few fields or attributes I can use to take actions on other fields within the same group. If there is secondary data I&amp;#39;m consuming that is likely to change and I need to know what it was at the point it was loaded into the form, I put that in a main DS.&lt;/p&gt;&lt;p&gt;So - in this case, I&amp;#39;d probably have a view that relates students to courses in my DB, my student ID field in my main DS, and execute a query off the student ID field to get student and course info, then populate my form&amp;#39;s main DS accordingly. If you are using DBXL &amp;amp; qRules, you won&amp;#39;t need custom code for any of this.&lt;/p&gt;</description></item><item><title>Design Question - Loading content into form with select box</title><link>https://www.infopathdev.com:443/forums/thread/88904.aspx</link><pubDate>Sat, 13 Apr 2013 03:38:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88904</guid><dc:creator>RobSil1976</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88904.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=88904</wfw:commentRss><description>Hi there,

Imagine you have a &amp;quot;student admin&amp;quot; form that lets you load students out of your student DB and edit their basic info (e.g. age, DOB - all fields in 1 row in DB) plus edit a repeating table of their courses along with teacher name, room number, etc..  The form has a search field at the top that you type a student ID into which will load the rest of the forms contents into view on an OnChanged event.

What is the best design to your form to accomplish this as far as fields in main data source and helper datasources?  Still not quite able to conceptualize things... if I was to have a field you can type a student ID into at the top to populate the rest of the form... should the ID be associated to a field in my main data source and I then query the DB using this as a param?  Or is it better to have the field be a secondary data source and have it copy into the main datasource upon load?  And would I need to do anything tricky for the nested group for my courses associated to the student?  Not sure if this means 2 queries to fill out form completely, or it can be done with 1 query (assuming I have proper relational model in DB with PK-FK between student and courses)?

Thx,
Robin</description></item></channel></rss>