Switching Views PRogrammatically (Dropdown list box)

T

Thiru

I am trying to Switch views depends on the selection in the dropdown list
box...After this event, its picking up the value correctly but not switching
views.

The error message i get is "Invalid Context for OM Call"

I have copied the code below for your comments and advise....


function msoxd_my_Sub_Category_MFab::OnAfterChange(eventObj)
{
// Write code here to restore the global state.

if (eventObj.IsUndoRedo)
{
// An undo or redo operation has occurred and the DOM is read-only.
return;
}

// A field change has occurred and the DOM is writable. Write code here to
respond to the changes.
var optionvalue = eventObj.Site.text;
//XDocument.UI.Alert(optionvalue);
if (optionvalue == 1)
{
XDocument.View.SwitchView("Major_Fabrication");
}
if (optionvalue ==2)
{
XDocument.View.SwitchView("Rigging");
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top