Override Busy Indicator - Cancel action [message #1843596] |
Tue, 10 August 2021 10:54  |
Eclipse User |
|
|
|
Hi all,
In my application people can query large amounts of data that may take some time depending on the constructed query.
When the query takes longer then 2.5 seconds (by default) a busy indicator shows up with a cancel button.
I would like to implement some logic when the user presses the cancel button, also the running database query is cancelled.
Does anyone know how i can catch that 'cancel' action so i can add some logic at that point?
I know how i can cancel the active user database query, but do not know where to implement that logic.
Thanks a lot for any help
|
|
|
Re: Override Busy Indicator - Cancel action [message #1843604 is a reply to message #1843596] |
Tue, 10 August 2021 12:20   |
Eclipse User |
|
|
|
Hi Michiel
You can try to implement a org.eclipse.scout.rt.platform.transaction.ITransactionMember
See org.eclipse.scout.rt.server.jdbc.AbstractSqlTransactionMember.cancel() as a sample on how you could implement the cancel() method.
This member can e.g. be registered using ITransaction.CURRENT.get().registerMemberIfAbsentAndNotCancelled()
You should register it before you create the resource that belongs to the transaction and needs some rollback or cancellation. At the moment the user cancels the operation the corresponding transaction will be cancelled as well and the cancel() method of your transaction member should be called.
Does this work for you?
Kind regards
Mat
|
|
|
|
Powered by
FUDForum. Page generated in 0.03593 seconds