<?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>Controls</title><link>https://www.infopathdev.com:443/forums/43.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Need help setting Current Row field on repeating table from another view</title><link>https://www.infopathdev.com:443/forums/thread/50592.aspx</link><pubDate>Wed, 13 Jan 2010 23:15:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50592</guid><dc:creator>vinnyng</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50592.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=50592</wfw:commentRss><description>&lt;p&gt;Ok, here is the c# managed code equivalent.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; btnSelPartNum_Clicked(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;ClickedEventArgs&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; e)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; root = MainDataSource.CreateNavigator();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; container = root.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:travelRequest/my:group1/my:Row[position() = /my:travelRequest/my:CurrentRow]/my:ExtPartNum&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (container != &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;container.SetValue(e.Source.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;ns4:PartNumber&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; container2 = root.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;/my:travelRequest/my:group1/my:Row[position() = /my:travelRequest/my:CurrentRow]/my:Description&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (container2 != &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;container2.SetValue(e.Source.SelectSingleNode(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;ns4:MarketingDescription&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).Value);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: Need help setting Current Row field on repeating table from another view</title><link>https://www.infopathdev.com:443/forums/thread/50590.aspx</link><pubDate>Wed, 13 Jan 2010 22:24:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50590</guid><dc:creator>vinnyng</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50590.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=50590</wfw:commentRss><description>&lt;p&gt;Ok, it looks like I might of caused my own error. I also had old code from the button event that produced that error and after commenting it out it stopped producing it. So the problem I have now is that Web based&amp;nbsp;Infopath&amp;nbsp;Forms do not support the XPath function position(). So it looks like I might have to write c# managed code to replicated the same thing unless anybody knows another way through Rule based. If not, a sample c# code would be great.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks,&lt;/p&gt;
&lt;p&gt;Vinny&lt;/p&gt;</description></item><item><title>Re: Need help setting Current Row field on repeating table from another view</title><link>https://www.infopathdev.com:443/forums/thread/50579.aspx</link><pubDate>Wed, 13 Jan 2010 20:23:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50579</guid><dc:creator>vinnyng</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50579.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=50579</wfw:commentRss><description>&lt;p&gt;The weird thing is that it correctly sets the value to the correct row but throws the error &amp;quot;Expression must evaluate to a node-set.&amp;quot; for some odd reason.&lt;/p&gt;</description></item><item><title>Need help setting Current Row field on repeating table from another view</title><link>https://www.infopathdev.com:443/forums/thread/50577.aspx</link><pubDate>Wed, 13 Jan 2010 20:12:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:50577</guid><dc:creator>vinnyng</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/50577.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=50577</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have a repeating table that has a button to go get the &amp;quot;ExtPartNum&amp;quot; from another view called &amp;quot;Get Part&amp;quot; and also set the CurrentRow field from my Line field. The &amp;quot;Get Part&amp;quot; view is a search with a text box and button to retrieve a web service and fill out the repeating table with a matching Part Number pattern. So I created a rule to set a field value for the main view&amp;#39;s&amp;nbsp;ExtPartNum to equal to the selected PartNum. Here is my Source code&amp;nbsp;below for those 2 button rules for InfoPath.&amp;nbsp;I get&amp;nbsp;this error when clicking on the button on the Get Part view.&lt;/p&gt;
&lt;p&gt;Error :&lt;/p&gt;
&lt;p&gt;System.Xml.XPath.XPathException&lt;br /&gt;Expression must evaluate to a node-set.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Rule on Main View:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:ruleSet name=&amp;quot;ruleSet_13&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:rule caption=&amp;quot;Rule 1&amp;quot; isEnabled=&amp;quot;yes&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:assignmentAction targetField=&amp;quot;../../my:CurrentRow&amp;quot; expression=&amp;quot;my:line&amp;quot;&amp;gt;&amp;lt;/xsf:assignmentAction&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:switchViewAction view=&amp;quot;Get Part&amp;quot;&amp;gt;&amp;lt;/xsf:switchViewAction&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/xsf:rule&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/xsf:ruleSet&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Rule on Get Part View:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:ruleSet name=&amp;quot;ruleSet_14&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:rule caption=&amp;quot;SetExtPartNum&amp;quot; isEnabled=&amp;quot;yes&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:assignmentAction targetField=&amp;quot;xdXDocument:get-DOM()/my:travelRequest/my:group1/my:Row[position() = /my:travelRequest/my:CurrentView]/my:ExtPartNum&amp;quot; expression=&amp;quot;ns4:PartNumber&amp;quot;&amp;gt;&amp;lt;/xsf:assignmentAction&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsf:switchViewAction view=&amp;quot;Create New Request&amp;quot;&amp;gt;&amp;lt;/xsf:switchViewAction&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/xsf:rule&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/xsf:ruleSet&amp;gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>