Closed d2a-raudenaerde closed 8 years ago
Ah, this will work as well and is a lot simpler / easier to understand. I think the DragSource
also needs this, as the DragSource
can be removed by ajax as well?
In #onExpired() you can handle both cases: the DragSource is no longer present or the actually dragged component inside the DragSource is already removed.
Should the DropTarget no longer be in the component tree, the request will fail anyway, since Wicket cannot resolve the behavior to receive the request.
Hi Sven,
Here is a pull request. I could not get the built-in Eclipse formatter to format the code exactly like yours, so the diff contains more changes than just the functional one. (I think you even use different formats for files, because I noticed sometimes the open braces are on a newline, sometimes trailing) Maybe you just want to ignore this pull request and just take the relevant portions.
The main changes are that both the
DragSoruce
and theDropTarget
check if the markupId is still valid. If not, theTransfer
will be rejected.Maybe a even better solution would be to follow an
onNoLongerValid()
path, but for now it preventsPageExpiredExceptions
. Our end-users this will benefit, because they no longer have to start-over when constructing filters using dnd, it just silently fails now.I think ideally drag-n-drop should be prevented (this could be done by either putting a veil on the entire page, or disabling drag-n-drop javascript on the global ajax handlers).