Printing SelectNodes works for Primay DataSource but not for Secondary can you explain why? - InfoPath Dev
in

InfoPath Dev

Printing SelectNodes works for Primay DataSource but not for Secondary can you explain why?

Last post 09-27-2007 11:34 AM by justindevine. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 09-27-2007 11:34 AM

    Printing SelectNodes works for Primay DataSource but not for Secondary can you explain why?

    Can someone explain this to me?   

    When trying to print a parent node in a Primary DataSource the following code produces a dialog box with all fields in that parent node.  AttendGroup is a repeating table in the form in which this code works.  All the fields are printed in one dialog box for each row in the repeating table.

    var nodeList = XDocument.DOM.selectNodes("my:myFields/my:AttendGroup")

    var node

    while( ( node = nodeList.nextNode()) != null)

    {

    XDocument.UI.Alert(node.text)

    }

     

    "Workshop History" is a SharePoint list.  The following code returns a blank dialog box for each row in the SharePoint List. 

    var oSharePointDom = XDocument.GetDOM("Workshop History") oSharePointDom.setProperty("SelectionNamespaces",'xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"');
    var sharedItems = oSharePointDom.selectNodes("/dfs:myFields/dfs:dataFields/dfs:Workshop_History")

    while( ( node = sharedItems.nextNode()) != null)

    {

    XDocument.UI.Alert(node.text)

    } 

     

    Can someone explain why printing the whole node does not work when using a secondary data source, but does work for primary ones?  BTW I don't believe this is a namespace issue as i can access individual fields.  For example XDocument.UI.Alert(node.selectSingleNode( "@First_Name" ).text works just fine if I put it in the while loop I get a list of all the First Names in the SharePoint list so while I have solved my problem I want to understand why the secondary data source works differently here.  THANKS!

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