ITransactionsExecuteStickyTransaction Method

Spotfire 14.3 API Reference
Starts a sticky transaction on the document model by executing executor.

Namespace:  Spotfire.Dxp.Framework.DocumentModel
Assembly:  Spotfire.Dxp.Framework (in Spotfire.Dxp.Framework.dll) Version: 65.0.19510.3242 (65.0.19510.3242)
Syntax

C#
void ExecuteStickyTransaction(
	Guid guid,
	Executor executor
)

Parameters

guid
Type: SystemGuid
The id which identifies the transactions which should stick together.
executor
Type: Spotfire.Dxp.Framework.DocumentModelExecutor
The delegate to execute.
Remarks

This method starts a sticky transaction on the document model by executing executor. If there is already an ongoing transaction then the transaction is included in the current transaction.

All modifications of the document that are performed as a result of the operations performed by executor will be recorded in the transaction so that the transaction can be unexecuted if the user requests an undo.

Sticky transactions should be used to implement undo of for example sliders. When you move a slider such as the range slider in the filter panel it makes a modification of the document and this modification should immediately be reflected in the user interface. However there should only be one entry on the undo stack so that the entire drag of the slider can be undone by pressing undo once.

To implement this behaviour the slider should generate a Guid and use it as a parameter to one sticky transactions for each modification.

The transactions are sticky in the sense that consecutive sticky transactions with the same Guid will yield a common entry on the undo stack. If any other transaction is executed it will create an independent entry which will break up the sequence of sticky transactions.

A sequence of sticky transactions is similar to an aggregated transaction in the sense that both will yield only one entry on the undo stack. However it is more robust to use sticky transactions if it is difficult to decide when an aggregated transaction should be committed.

Version Information

Supported in: 14.3, 14.2, 14.1, 14.0, 12.5, 12.4, 12.3, 12.2, 12.1, 12.0, 11.8
See Also

Reference