<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Programmatically read all nodes in List Box</title><link>https://www.infopathdev.com:443/forums/thread/38848.aspx</link><pubDate>Tue, 24 Feb 2009 14:58:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38848</guid><dc:creator>Petronomicon</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38848.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38848</wfw:commentRss><description>&lt;p&gt;Hi Jimmy.&lt;/p&gt;
&lt;p&gt;Sorry for the delay - hope your still following this thread.&amp;nbsp; In a nutshell:&lt;/p&gt;
&lt;p&gt;I have data in a SharePoint list I want to make available in my infopath form.&amp;nbsp; Data can easily&amp;nbsp;be brought into the list box from SharePoint.&lt;/p&gt;
&lt;p&gt;I was hoping to be able to access the data in the list box through the DOM, but I can only read 1 element - whichever element&amp;nbsp;is selected from the InfoPath screen. (An aside, I did see somewhere where you can read the elements using XML but that is new to me). Your statement that a list box is an Output and not&amp;nbsp;input makes sense in this matter.&lt;/p&gt;
&lt;p&gt;So I changed the InfoPath script to go after the Secondary Data Source programmatically and read the elements from the SharePoint list into a repeating table structure using the &amp;#39;cloneNode&amp;#39; method.&lt;/p&gt;
&lt;p&gt;This is OK, but I was hoping to use the list box to cut down on the whole cloneNode/parent/child coding thing.&amp;nbsp; I have it working now but thanks for your help.&lt;/p&gt;
&lt;p&gt;Dave&lt;/p&gt;</description></item><item><title>Re: Programmatically read all nodes in List Box</title><link>https://www.infopathdev.com:443/forums/thread/38666.aspx</link><pubDate>Fri, 20 Feb 2009 04:57:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38666</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38666.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38666</wfw:commentRss><description>&lt;p&gt;Hello again,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I&amp;#39;m not entirely clear on what you&amp;#39;re trying to do.&amp;nbsp; If you&amp;#39;re just trying to access a bunch of values in code, then getting at them in a secondary data source should not be all that more complicated than accessing it in the main data source; really just the code you have up there with a few lines changed and a few extra.&lt;/p&gt;</description></item><item><title>Re: Programmatically read all nodes in List Box</title><link>https://www.infopathdev.com:443/forums/thread/38630.aspx</link><pubDate>Thu, 19 Feb 2009 15:39:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38630</guid><dc:creator>Petronomicon</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38630.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38630</wfw:commentRss><description>&lt;p&gt;Thanks again!&lt;/p&gt;
&lt;p&gt;Yeah, I can get at the data programmatically so it&amp;#39;s no big deal.&amp;nbsp; I was just hoping I could cut down on the amount of code.&lt;/p&gt;
&lt;p&gt;Thanks for your response!&lt;/p&gt;
&lt;p&gt;Get some sleep and have a great tomorrow!&lt;/p&gt;</description></item><item><title>Re: Programmatically read all nodes in List Box</title><link>https://www.infopathdev.com:443/forums/thread/38629.aspx</link><pubDate>Thu, 19 Feb 2009 15:36:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38629</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38629.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38629</wfw:commentRss><description>&lt;p&gt;If the listbox is already being populated from the SharePoint list, then there is no need to add any extra XML.&amp;nbsp; The data is already there.&amp;nbsp; You just need to have your code access the values from your secondary data connection instead of the ListBox&amp;#39;s bound node.&amp;nbsp; If you&amp;#39;re unsure how to do this I can show you sometime tomorrow (it&amp;#39;s already late here in Japan).&lt;/p&gt;</description></item><item><title>Re: Programmatically read all nodes in List Box</title><link>https://www.infopathdev.com:443/forums/thread/38623.aspx</link><pubDate>Thu, 19 Feb 2009 14:27:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38623</guid><dc:creator>Petronomicon</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38623.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38623</wfw:commentRss><description>&lt;p&gt;Thanks Jimmy!&lt;/p&gt;
&lt;p&gt;The values are stored in a SharePoint list, and I&amp;#39;m using a secondary data connection to populate the field when the form opens.&amp;nbsp; I was going to use it as a list to populate an email but can only access one element.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I understand what you are saying, and I did see that there were some tips on the internet about accessing it through XML, but have never done that, although I&amp;#39;m game to try.&lt;/p&gt;
&lt;p&gt;Could you post the code, or point me to a resource?&amp;nbsp; Or if you have a better way to read values into a form from a SharePoint list, then have them available programmatically, that would be great.&lt;/p&gt;
&lt;p&gt;(I ended up using a repeatable table and using &amp;quot;cloneNode&amp;quot; to display the values, but I was trying to find a way that didn&amp;#39;t require so much coding.)&lt;/p&gt;
&lt;p&gt;Thanks again for your help!!&lt;/p&gt;
&lt;p&gt;Dave&lt;/p&gt;</description></item><item><title>Re: Programmatically read all nodes in List Box</title><link>https://www.infopathdev.com:443/forums/thread/38603.aspx</link><pubDate>Thu, 19 Feb 2009 00:38:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38603</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38603.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38603</wfw:commentRss><description>&lt;p&gt;What are you using as the data source for the values in the list box?&amp;nbsp;&amp;nbsp;Are they values you manually entered in the form designer?&amp;nbsp; In InfoPath the value of a node bound to a list box is the value of the selected values.&amp;nbsp; Since it is an input control I&amp;#39;m sure you will agree that this does make sense.&lt;/p&gt;
&lt;p&gt;If you want to also have access to all the values in the list box, I would suggest making an XML file with the values you want&amp;nbsp;and using that as a secondary data source to populate the list box.&lt;/p&gt;</description></item><item><title>Programmatically read all nodes in List Box</title><link>https://www.infopathdev.com:443/forums/thread/38574.aspx</link><pubDate>Wed, 18 Feb 2009 17:03:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38574</guid><dc:creator>Petronomicon</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38574.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=38574</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It seems like this issue should be easy.&amp;nbsp; I&amp;#39;m simply trying to read the list box elements in my InfoPath form&amp;nbsp;script.&lt;/p&gt;
&lt;p&gt;I set the following variable but &lt;strong&gt;I only retrieve the first value or the selected value&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not getting an error, just not reading through all of the elements of the list box.&lt;/p&gt;
&lt;p&gt;var xIncentives_A = XDocument.DOM.selectNodes(&amp;quot;/my:myFields/my:Incentives[my:Incentives_Apvr != &amp;#39; &amp;#39;]&amp;quot;);&lt;/p&gt;
&lt;p&gt;var itemTotalNode = null;&lt;/p&gt;
&lt;p&gt;var sendTos = &amp;quot;&amp;quot;;&lt;/p&gt;
&lt;p&gt;xIncentives_A.reset();&lt;/p&gt;
&lt;p&gt;while (itemTotalNode = xIncentives_A.nextNode()) { &lt;/p&gt;
&lt;p&gt;&amp;nbsp; var nItemTotal = itemTotalNode.nodeTypedValue; XDocument.UI.Alert(nItemTotal);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;sendTos += nItemTotal;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;I am completely stuck.&amp;nbsp; Thanks for your help.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>