Jump to content

Spotfire crashes when trying to Remove Page using Ironpython


Lloyd Plum

Recommended Posts

Trying to execute the following code:

for page in Document.Pages:

if page.Title == pageName:

Document.Pages.Remove(page)

Without fail, this results in the program crashing. If I execute within the Ironpython scripting window, I get the following error (followed by a crash when I exit the scripting window):

System.InvalidOperationException: Attempt to start ReadTransaction in state 'Detached'.

at Spotfire.Dxp.Framework.DocumentModel.Node.ReadTransaction[T](ValueReader`1 valueReader)

at Spotfire.Dxp.Application.WebView.DataPanelWebView.BuildColumnListState()

at Spotfire.Dxp.Application.WebView.DataPanelWebView.UpdateAllListBoxes(Boolean rebuildColumnListState, Boolean resetScrollingAndAnchor)

at Spotfire.Dxp.Framework.DocumentModel.ExternalThreadSafeEventHandlerConnection.RaiseNotUpToDateCallback()

at Spotfire.Dxp.Framework.Commands.CommandHistory.RaiseNotUptoDateWorkPackages()

at Spotfire.Dxp.Framework.Commands.CommandHistory.c__DisplayClass1.b__0()

at Spotfire.Dxp.Forms.Application.FormsApplicationThread.InvokeOnUIThreadAndTransferTransactionStartPermission(ApplicationInvocation method)

at Spotfire.Dxp.Framework.Commands.CommandHistory.CommitOutermostTransaction(Object busyProof, Boolean oldHiding, Boolean sticky, Guid stickyGuid)

at Spotfire.Dxp.Framework.Commands.CommandHistory.OutermostTransactionHandle.PerformCommit()

at Spotfire.Dxp.Framework.Commands.CommandHistory.Transaction(Executor executor, Boolean visible, Boolean sticky, Guid stickyGuid)

at Spotfire.Dxp.Framework.Commands.CommandHistory.Transaction(String displayName, Executor executor)

at Spotfire.Dxp.Application.Scripting.ScriptManager.ExecuteScriptForDebugging(String scriptCode, Dictionary`2 scriptArguments, String& output)

at Spotfire.Dxp.Forms.Framework.Scripting.ScriptEditDialog.RunButton_Click(Object sender, EventArgs e)

Version is 6.5.3

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...