<?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>Views</title><link>https://www.infopathdev.com:443/forums/42.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/37273.aspx</link><pubDate>Sat, 17 Jan 2009 08:41:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37273</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37273.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=37273</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You to follow these steps to insert OnSwitchView in Jscript,&lt;/p&gt;
&lt;p&gt;1. Go to Tools- &amp;gt; Form Options -&amp;gt; Programming.&lt;/p&gt;
&lt;p&gt;2. Select ‘Jscript&amp;#39; in ‘Form template code language&amp;#39; dropdown.&lt;/p&gt;
&lt;p&gt;3. Click on OK button.&lt;/p&gt;
&lt;p&gt;4. Go to Tools -&amp;gt; Programming -&amp;gt; ‘On Switch View Event..&amp;#39;&lt;/p&gt;
&lt;p&gt;You will get script.js file with ‘OnSwitchView&amp;#39; event. In this you have to add the above swathi code.&lt;/p&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/37272.aspx</link><pubDate>Sat, 17 Jan 2009 07:56:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37272</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37272.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=37272</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Add a filed to data source (ex: field1 and its xpath is like /my:myFields/my:field1). Before submitting the form, write the following code.&lt;/p&gt;
&lt;p&gt;XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:field1&amp;quot;).text = XDocument.View.Name;&lt;/p&gt;
&lt;p&gt;Add a switch view event and write the following code.&lt;/p&gt;
&lt;p&gt;function XDocument::OnSwitchView(eventObj) &lt;/p&gt;
&lt;p&gt;{ &lt;/p&gt;
&lt;p&gt;var viewName = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:field1&amp;quot;).text; &lt;/p&gt;
&lt;p&gt;XDocument.View.SwitchView(viewName);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;}&lt;/p&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/37242.aspx</link><pubDate>Fri, 16 Jan 2009 18:28:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37242</guid><dc:creator>vickie</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37242.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=37242</wfw:commentRss><description>&lt;p&gt;Thanks.&amp;nbsp; I think this theory will work, but I&amp;#39;m new to InfoPath and never had the experience on JavaScript.&amp;nbsp; Could you show me where to insert the code (when saved and open) and what exactly the code will be?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/37226.aspx</link><pubDate>Fri, 16 Jan 2009 13:57:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37226</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37226.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=37226</wfw:commentRss><description>Hi, 
&lt;p&gt;Before saving the form get the view name by using the following code line.&lt;/p&gt;
&lt;p&gt;thisXDocument.View.Name &lt;/p&gt;
&lt;p&gt;and store this value in a field.&lt;/p&gt;
&lt;p&gt;When you open the form use this value to open the view using the above post code.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/37176.aspx</link><pubDate>Thu, 15 Jan 2009 20:35:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37176</guid><dc:creator>rishibajaj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37176.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=37176</wfw:commentRss><description>&lt;p&gt;you can make a particular view to get opened by this code&lt;/p&gt;&lt;font color="#008000" size="2"&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;
&lt;p&gt;ViewInfos.SwitchView(&amp;quot;Name of your view&amp;quot;);&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/37170.aspx</link><pubDate>Thu, 15 Jan 2009 19:43:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37170</guid><dc:creator>vickie</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37170.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=37170</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have created a form using different views and controlled by the buttons.&amp;nbsp; Once the view was selected and saved, I want the same view displayed when the form was opened again.&amp;nbsp;&amp;nbsp; But when I try to open the form, it always gives me the default view,&amp;nbsp;&amp;nbsp; is there a way I can do that?&amp;nbsp; Any helps will be appreciated.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Vickie&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/34897.aspx</link><pubDate>Tue, 25 Nov 2008 14:01:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34897</guid><dc:creator>Anuma</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34897.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=34897</wfw:commentRss><description>&lt;p&gt;I don&amp;#39;t know how to close the view. But below is the once option to refresh the page.&lt;/p&gt;
&lt;p&gt;If you want to refresh the page&amp;nbsp;after submitting data to database, then you need to add the rule to a button to clear the values. Other wise you can write those code to clear the values.&lt;/p&gt;
&lt;p&gt;Add following rule to the button after submitting to the Db. &lt;/p&gt;
&lt;ol style="MARGIN-TOP:0in;"&gt;
&lt;li class="MsoNormal" style="MARGIN:0in 0in 0pt;mso-list:l1 level1 lfo2;tab-stops:list .5in;"&gt;&lt;font face="Times New Roman" size="3"&gt;Double click on the button and Select Rules button.&lt;/font&gt; 
&lt;li class="MsoNormal" style="MARGIN:0in 0in 0pt;mso-list:l1 level1 lfo2;tab-stops:list .5in;"&gt;&lt;font face="Times New Roman" size="3"&gt;Click on “Add” button &lt;/font&gt;
&lt;li class="MsoNormal" style="MARGIN:0in 0in 0pt;mso-list:l1 level1 lfo2;tab-stops:list .5in;"&gt;&lt;font face="Times New Roman" size="3"&gt;Click on “Add Action” button.&lt;/font&gt; 
&lt;li class="MsoNormal" style="MARGIN:0in 0in 0pt;mso-list:l1 level1 lfo2;tab-stops:list .5in;"&gt;&lt;font face="Times New Roman" size="3"&gt;Select “Set a Field Value” from Action field.&lt;/font&gt; 
&lt;li class="MsoNormal" style="MARGIN:0in 0in 0pt;mso-list:l1 level1 lfo2;tab-stops:list .5in;"&gt;&lt;font face="Times New Roman" size="3"&gt;Select field xpath from “Field” text box.&lt;/font&gt; 
&lt;li class="MsoNormal" style="MARGIN:0in 0in 0pt;mso-list:l1 level1 lfo2;tab-stops:list .5in;"&gt;&lt;font face="Times New Roman" size="3"&gt;Leave “Value” as blank. &lt;/font&gt;
&lt;li class="MsoNormal" style="MARGIN:0in 0in 0pt;mso-list:l1 level1 lfo2;tab-stops:list .5in;"&gt;&lt;font face="Times New Roman" size="3"&gt;Click on ok.&lt;/font&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="MARGIN:0in 0in 0pt;mso-list:l1 level1 lfo2;tab-stops:list .5in;"&gt;&lt;font face="Times New Roman" size="3"&gt;Follow the same steps from&amp;nbsp; 3 to 7 for other fields.&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;mso-list:l1 level1 lfo2;tab-stops:list .5in;"&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/34888.aspx</link><pubDate>Tue, 25 Nov 2008 13:29:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34888</guid><dc:creator>rishibajaj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34888.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=34888</wfw:commentRss><description>&lt;p&gt;one form can have many views in it. my intention was to close the view when i am moving out of that view. for example if i am in insert view and i have inserted some records in database and when i press save button i want insert view to get closed so that if i am opening the insert view again values in insert view should get cleared instead of&amp;nbsp;code clearing the each form individually.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;that&amp;#39;s why i wanted to close the view. is there any way to close the view in c#?&lt;/p&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/34887.aspx</link><pubDate>Tue, 25 Nov 2008 13:19:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34887</guid><dc:creator>Anuma</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34887.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=34887</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Close view means, do you want to switch to other view.&lt;/p&gt;
&lt;p&gt;As of my knowledge there is no way to close one single view. Because form will open in one view.&lt;/p&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/34885.aspx</link><pubDate>Tue, 25 Nov 2008 13:05:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34885</guid><dc:creator>rishibajaj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34885.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=34885</wfw:commentRss><description>&lt;p&gt;I want to close view and not form. Is there a way to close a view using C# in infopath 2007?&lt;/p&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/34877.aspx</link><pubDate>Tue, 25 Nov 2008 12:01:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34877</guid><dc:creator>Anuma</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34877.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=34877</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;Below code will work to close the Infopath2007 form.&lt;/font&gt;&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;this&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.Application.ActiveWindow.Close();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;If you working on browser form, then it will not work. You need to add the rule to close the form.&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/34875.aspx</link><pubDate>Tue, 25 Nov 2008 11:21:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34875</guid><dc:creator>rishibajaj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34875.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=34875</wfw:commentRss><description>&lt;p&gt;I am working on C# as programming language in infopath 2007&amp;nbsp;so above code will not work for c#.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;How can I close the view using C# in infopath 2007?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks&lt;/p&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/34859.aspx</link><pubDate>Tue, 25 Nov 2008 07:26:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34859</guid><dc:creator>Shiva</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34859.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=34859</wfw:commentRss><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Closing InfoPath form view means we have to shift one view to another view. At a time we can see only one in InfoPath. Above Anuma given code is for close the InfoPath form.&lt;/p&gt;</description></item><item><title>Re: how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/34849.aspx</link><pubDate>Tue, 25 Nov 2008 03:54:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34849</guid><dc:creator>Anuma</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34849.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=34849</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can use the following code line to close the form.&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;span style="FONT-SIZE:10pt;COLOR:black;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-themecolor:text1;mso-no-proof:yes;"&gt;thisXDocument.View.Window.Close(true);&lt;/span&gt;&lt;span style="COLOR:black;mso-themecolor:text1;"&gt;&lt;/span&gt;&lt;/font&gt; &lt;/p&gt;</description></item><item><title>how to close views programatically</title><link>https://www.infopathdev.com:443/forums/thread/34846.aspx</link><pubDate>Tue, 25 Nov 2008 03:08:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:34846</guid><dc:creator>rishibajaj</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/34846.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=34846</wfw:commentRss><description>&lt;p&gt;how can i close infopath views programatically. i am using c# in vsta.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;thanks&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>