"Invalid context for OM call" when SwitchView is called - InfoPath Dev
in

InfoPath Dev

"Invalid context for OM call" when SwitchView is called

Last post 04-04-2008 07:46 AM by kerplunk. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-04-2008 07:30 AM

    "Invalid context for OM call" when SwitchView is called

    (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:

     

    function msoxd__Job_uglyHack.view_attr::OnAfterChange(eventObj)
    {
    var sChangedNode = XDocument.DOM.selectSingleNode("//d:Job/@uglyHack.view").nodeValue;

    if (eventObj.IsUndoRedo || eventObj.Operation != "Insert")
    {
    // An undo or redo operation has occurred and the DOM is read-only.
    return;
    }
    XDocument.View.SwitchView(sChangedNode);
    }

    I feel like I've missed something really obvious, but I'm just not seeing it. 

  • 04-04-2008 07:46 AM In reply to

    Looks like my question was already answered here. Can't call a view switch on an OnAfterChange event.
    Amazing what you learn when you actually read the other posts ;)

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.