<?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: Select all items in secondary filtered multiple list box</title><link>https://www.infopathdev.com:443/forums/thread/87352.aspx</link><pubDate>Sun, 24 Feb 2013 03:43:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:87352</guid><dc:creator>moldar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/87352.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=87352</wfw:commentRss><description>&lt;p&gt;I just got done doing something very similar, except mine were SharePoint lists. First lists was a transaction type list. Inside of this list was a lookup to an approvers list. The user selects whichever approvers should be used for each transaction type in SP.&lt;/p&gt;
&lt;p&gt;So in Infopath the transactions list and the approvers list are both data connections. I needed to do something very similar to what you are doing. I ended up using code to create a table in my schema to store the list of all the possible approvers. I had this table filled by my Form_Load whenever the form is opened, and added a field named ApproverRequired to it as a check box.&lt;/p&gt;
&lt;p&gt;So once the form opens we have the multi-select box showing the list of transactions. They can pick however many they want. Once they are done they click a button which calls the following code:&lt;/p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;//This method determines which approvals are required.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//Setup Transaction Types Navigator for later use.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; transNavRoot = DataSources[&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Transaction Types&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;].CreateNavigator();&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; root = MainDataSource.CreateNavigator();&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;//This is the multi-select field&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNodeIterator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; iterStandardCOSTran = root.Select(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:COS/my:COSTransactionIdentification/my:StandardTransactions&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; selectedTransId = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Empty;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;//Loop through the values in the transaction multiselect&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;foreach&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; transNav &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;in&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; iterStandardCOSTran)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&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; (!&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.IsNullOrEmpty(transNav.Value))&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;selectedTransId = transNav.Value;&lt;/p&gt;
&lt;p&gt;//This looks up the specific transaction id from the Transactions data source&lt;/p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; trans = transNavRoot.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW[d:ID = &amp;#39;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + selectedTransId + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;&amp;#39;]&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font size="2"&gt;SetRequiredApprovers(trans.Select(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;d:Approval_x0020_Roles/Value&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager));&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;So as it finds the values that were selected in the multi-select it loops through them and calls the SetRequireApprovers method which gets passed the list of approval roles that are required for that transaction type.&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;private&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; SetRequiredApprovers(&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNodeIterator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; approvers)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;//Loop through provided iterator and set each approver role it contains to required for approval.&lt;/p&gt;&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;while&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; (approvers.MoveNext())&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;//This line gets a navigator to the specific approver role we are currently looping through.&lt;/p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;XPathNavigator&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; approver = MainDataSource.CreateNavigator().SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/my:COS/my:ApproverIdentification/my:ApprovalRole[my:ApprovalRoleID = &amp;#39;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; + approvers.Current.Value + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;&amp;#39;]&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager);&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;//Finally we set the ApprovalRequired flag to true to indicate that&amp;nbsp;this approver is required.&amp;nbsp;&lt;/p&gt;approver.SelectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;my:ApprovalRequired&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, NamespaceManager).SetValue(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;true&amp;quot;&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;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;I know this is probably confusing and may be of no use to you, but I thought I would try to help, since your problem sounds similar to mine.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Select all items in secondary filtered multiple list box</title><link>https://www.infopathdev.com:443/forums/thread/87314.aspx</link><pubDate>Thu, 21 Feb 2013 19:40:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:87314</guid><dc:creator>meisterfitz</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/87314.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=87314</wfw:commentRss><description>Hi

I have a multiple list box which receives it&amp;#39;s data from a SQL table. I have another multiple list box which receives fields from another SQL table filtered on whatever was selected in the first multiple list box. I want the second multiple list box not to be choices, but to have all the entries selected (can i use anything other than a multiple list box, for multiple values?). The reason being the second multiple list box is hidden from the users.

I want the second filtered list box to basically be automatically checked, or more importantly their values captured.

The scenario is thus:

A user can work in 1 area up to 10 areas. Depending on the area worked an approver is filtered/received from the approvers SQL table. If the user works in more than one area, several approvers are required. This process of &amp;#39;selecting&amp;#39; approvers should be hidden from users. They can only select the area they work in and the approvers are selected automatically. PLEASE NOTE: There are TWO SQL tables - AREA and APPROVER (approver is filtered on area code - the underlying SQL schema CANNOT be changed).

Any help would be greatly appreciated.

Many thanks</description></item></channel></rss>