Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / August 2005

Tip: Looking for answers? Try searching our database.

can not call XDocument.View.SwitchView

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kenneth - 17 Aug 2005 01:23 GMT
I want to switch to another view when a drop-down select changed, but got
error below:

"Invalid context for OM call Infopath"

The function is:

function msoxd_my_secondarycategory::OnAfterChange(eventObj)
{
 var objMyDropdown;
 objMyDropdown =
XDocument.DOM.selectSingleNode("//my:category/my:secondarycategory");
   
 if ( objMyDropdown.text == "133" )
     XDocument.View.SwitchView('Software Request');
}
Anton L - 17 Aug 2005 01:33 GMT
Basically you can't do it onAfterChange. Read more on why here:
http://www.infopathdev.com/howto/tips/default.aspx?i=a71e3465487b46f0b11ae5a63eda8269

Instead you might want to use a button to "evaluate" the change and run the
OnClick script which would permit this.

>I want to switch to another view when a drop-down select changed, but got
>error below:
[quoted text clipped - 12 lines]
>      XDocument.View.SwitchView('Software Request');
>}
Kenneth - 17 Aug 2005 09:57 GMT
Thank you Anton.

> Basically you can't do it onAfterChange. Read more on why here:
> http://www.infopathdev.com/howto/tips/default.aspx?i=a71e3465487b46f0b11ae5a63eda8269
[quoted text clipped - 18 lines]
> >      XDocument.View.SwitchView('Software Request');
> >}
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.