<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>D'oh!</title><link>https://www.infopathdev.com:443/forums/thread/27704.aspx</link><pubDate>Fri, 04 Apr 2008 14:46:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:27704</guid><dc:creator>kerplunk</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/27704.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=27704</wfw:commentRss><description>&lt;p&gt;Looks like my question was already answered &lt;a href="http://www.infopathdev.com/forums/p/2891/6085.aspx#6085"&gt;here&lt;/a&gt;. Can&amp;#39;t call a view switch on an OnAfterChange event.&lt;br /&gt;Amazing what you learn when you actually read the other posts ;)&lt;/p&gt;</description></item><item><title>"Invalid context for OM call" when SwitchView is called</title><link>https://www.infopathdev.com:443/forums/thread/27703.aspx</link><pubDate>Fri, 04 Apr 2008 14:30:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:27703</guid><dc:creator>kerplunk</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/27703.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=27703</wfw:commentRss><description>&lt;p&gt;(IP 2003). I have a ddl with values that correspond to view names. SwitchView is called based on the selection in the list. Here is the offending snippet:&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;pre style="color:green;"&gt;function msoxd__Job_uglyHack.view_attr::OnAfterChange(eventObj)&lt;br /&gt;{&lt;br /&gt;	var sChangedNode = XDocument.DOM.selectSingleNode(&amp;quot;//d:Job/@uglyHack.view&amp;quot;).nodeValue;&lt;br /&gt;&lt;br /&gt;	if (eventObj.IsUndoRedo || eventObj.Operation != &amp;quot;Insert&amp;quot;)&lt;br /&gt;		{&lt;br /&gt;			// An undo or redo operation has occurred and the DOM is read-only.&lt;br /&gt;			return;&lt;br /&gt;		}&lt;br /&gt;	XDocument.View.SwitchView(sChangedNode);&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;I feel like I&amp;#39;ve missed something really obvious, but I&amp;#39;m just not seeing it.&amp;nbsp;

&lt;/p&gt;</description></item></channel></rss>