<?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: Switch to previous view on button click</title><link>https://www.infopathdev.com:443/forums/thread/38772.aspx</link><pubDate>Mon, 23 Feb 2009 04:27:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38772</guid><dc:creator>Votsar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38772.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=38772</wfw:commentRss><description>Awesome, thanks - works like a charm :)</description></item><item><title>Re: Switch to previous view on button click</title><link>https://www.infopathdev.com:443/forums/thread/38484.aspx</link><pubDate>Tue, 17 Feb 2009 05:41:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38484</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38484.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=38484</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Add a hidden field to the data source.&lt;/p&gt;
&lt;p&gt;Add an OnSwitchView event to the form and in the event write the following code.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;if (thisXDocument.View.Name != &amp;quot;&amp;lt;Cancel view name&amp;gt;&amp;quot;)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;thisXDocument.DOM.selectSingleNode(&amp;quot;&amp;lt;XPath of the hidden field&amp;gt;&amp;quot;).text = thisXDocument.View.Name;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt;Add an on click event for the ‘No&amp;#39; button and write the following code.&lt;/p&gt;
&lt;p&gt;viewName = thisXDocument.DOM.selectSingleNode(&amp;quot;&amp;lt;XPath of the hidden field&amp;gt;&amp;quot;).text;&lt;/p&gt;
&lt;p&gt;thisXDocument.View.SwitchView(viewName);&lt;/p&gt;</description></item><item><title>Switch to previous view on button click</title><link>https://www.infopathdev.com:443/forums/thread/38476.aspx</link><pubDate>Tue, 17 Feb 2009 01:26:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:38476</guid><dc:creator>Votsar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/38476.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=38476</wfw:commentRss><description>&lt;p&gt;Hey all,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I&amp;#39;m designing some forms that will be published to MOSS, and&amp;nbsp;because they are web-forms, you cannot have popups etc.&lt;/p&gt;
&lt;p&gt;The current form I&amp;#39;m busy with has about 10 different views, with a &amp;#39;Cancel&amp;#39; button on each view. The business requirements is to have a &amp;#39;Are you sure?&amp;#39; type request before closing the form when someone clicks &amp;#39;cancel&amp;#39;. I&amp;#39;ve added a new view called &amp;#39;Cancel&amp;#39; with a &amp;#39;yes&amp;#39; and &amp;#39;no&amp;#39; button on it, that will be navigated to whenever someone clicks on &amp;#39;cancel&amp;#39; in one of the 10 views.&lt;/p&gt;
&lt;p&gt;My problem is: if a user accidentally&amp;nbsp;clicks &amp;#39;cancel&amp;#39;, they get taken to the &amp;#39;cancel&amp;#39; view. however, because it was a mis-click or something, they don&amp;#39;t wan&amp;#39;t to close it, so they click &amp;#39;no&amp;#39;. My question is how do I take them back to the previous view that they were on? Is there a way to say &amp;quot;switch to view (x)&amp;quot; where x is a variable or hidden field or something that contains the previous view?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for any help&lt;/p&gt;</description></item></channel></rss>