<?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: InfoPath 2003 - need help on searching a textbox and to return results in dropdownlist (repeating table scenario)</title><link>https://www.infopathdev.com:443/forums/thread/70461.aspx</link><pubDate>Wed, 21 Sep 2011 06:33:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70461</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70461.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=70461</wfw:commentRss><description>&lt;p&gt;Why are you searching a text box? That&amp;#39;s a lot of work and requires code and that code won&amp;#39;t work in the InfoPath 2007 browser object model (nor InfoPath 2010 for that matter).&lt;/p&gt;&lt;p&gt;Instead, why not just change your secondary data source to get the list of people in a repeating XML structure. Then, you can just copy the person from the list into your main data source. That&amp;#39;s the easy approach. No need to write code here.&lt;/p&gt;</description></item><item><title>InfoPath 2003 - need help on searching a textbox and to return results in dropdownlist (repeating table scenario)</title><link>https://www.infopathdev.com:443/forums/thread/70459.aspx</link><pubDate>Wed, 21 Sep 2011 04:19:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70459</guid><dc:creator>wilfredocansino</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70459.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=70459</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m an InfoPath newbie, and I&amp;#39;m having problems on how to handle search, please help me out.&lt;/p&gt;
&lt;p&gt;Initially, I have&amp;nbsp;a textbox OnAfterChange event to handle logic:&lt;/p&gt;
&lt;p&gt;function msoxd_my_PersonResponsibleAux::OnAfterChange(eventObj) { &lt;/p&gt;
&lt;p&gt;var ADerror = &amp;quot;Unable to get Enterprise IDs from the server. Connection to the server may not be possible.&amp;quot;; &lt;/p&gt;
&lt;p&gt;if (eventObj.IsUndoRedo) { // An undo or redo operation has occurred and the DOM is read-only. return; } &lt;/p&gt;
&lt;p&gt;// A field change has occurred and the DOM is writable. Write code here to respond to the changes. &lt;/p&gt;
&lt;p&gt;try { if (IsUserOnline()) { &lt;/p&gt;
&lt;p&gt;updatePeople(eventObj.Site.text); &lt;/p&gt;
&lt;p&gt;XDocument.View.ForceUpdate();&amp;nbsp;} &lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;catch (e) { &lt;/p&gt;
&lt;p&gt;XDocument.UI.Alert(ADerror); return; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;function updatePeople(fieldValue) { &lt;/p&gt;
&lt;p&gt;//Get a reference to the SDS bound to the Web Service. &lt;/p&gt;
&lt;p&gt;var theDataObject = XDocument.DataObjects.Item(&amp;quot;PeoplePicker&amp;quot;); &lt;/p&gt;
&lt;p&gt;//Set the SelectionNamespaces so that you can find the correct field. &lt;/p&gt;
&lt;p&gt;theDataObject.DOM.setProperty(&amp;quot;SelectionNamespaces&amp;quot;, &amp;#39;xmlns:dfs=&amp;quot;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&amp;quot; &amp;#39; + &amp;#39;xmlns:s0=&amp;quot;http://tempuri.org/&amp;quot;&amp;#39;); &lt;/p&gt;
&lt;p&gt;var queryValue = theDataObject.DOM.selectSingleNode( &amp;quot;/dfs:myFields/dfs:queryFields/s0:GetEnterpriseIDsCompletionList/s0:prefixText&amp;quot; ); &lt;/p&gt;
&lt;p&gt;queryValue.text = fieldValue; &lt;/p&gt;
&lt;p&gt;queryValue = theDataObject.DOM.selectSingleNode( &amp;quot;/dfs:myFields/dfs:queryFields/s0:GetEnterpriseIDsCompletionList/s0:count&amp;quot; ); &lt;/p&gt;
&lt;p&gt;queryValue.text = 20;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;theDataObject.Query();&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Both codes are working, but&amp;nbsp;has to lose focus on the textbox first to fill the dropdownlist for the result, &lt;/p&gt;
&lt;p&gt;I&amp;#39;d like to introduce a new approach trough providing a Search button, and to eliminate OnAfterChange event of the textbox:&lt;/p&gt;
&lt;p&gt;function ::OnClick(eventObj){&lt;/p&gt;
&lt;p&gt;var ADerror = &amp;quot;Unable to get Enterprise IDs from the server. Connection to the server may not be possible.&amp;quot;; &lt;/p&gt;
&lt;p&gt;if (eventObj.IsUndoRedo) { // An undo or redo operation has occurred and the DOM is read-only. return; } &lt;/p&gt;
&lt;p&gt;// A field change has occurred and the DOM is writable. Write code here to respond to the changes. &lt;/p&gt;
&lt;p&gt;try { if (IsUserOnline()) { &lt;/p&gt;
&lt;p&gt;updatePeople(&lt;strong&gt;XDocument.DOM.selectSingleNode(&amp;quot;/my:QADeliverySurvey/my:ActionItems/my:ActionItem/my:PersonResponsibleAux&amp;quot;).text&lt;/strong&gt;); &lt;/p&gt;
&lt;p&gt;XDocument.View.ForceUpdate();&amp;nbsp;} &lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;catch (e) { &lt;/p&gt;
&lt;p&gt;XDocument.UI.Alert(ADerror); return; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Since controls are in a repeating table, whenever I have 2 tables and I do search on the 2nd table, dropdownlist of the first table is also affected by the update which should not be :(&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t know how to figure this out, please help me :( Or better if you can provide a better resolution.. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks a lot..&lt;/p&gt;</description></item></channel></rss>