You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have quite a large application that centers around search. On the left, there is a dropzone (for facets) where items from a list can be dropped. When an item is dropped, a query is modified, an Ajax-refresh is done and the list is refreshed. This works great as long as the user has enough patienct to wait for the center-list to be re-rendered by the browser.
However, it is possible for the user to quickly drag-and-drop TWO items in quick succession from the center to the left. The first causes a refresh of the list, so the markup-id's are no longer valid. However, because the browser so not yet received the new center, there are still items that can be dragged. These items will have invalid markup-ids. When the user drops the second item on the dropzone, a PageExpiredException is thrown by the MarkupIdVisitor.getComponent() in de getDrag() of the DragSource
I think it would be nice if the transfer can be rejected if the original item no longer exists. Currently it is not possible to prevent this behaviour.
What do you think? Maybe there are better methods of dealing with this problem?
The text was updated successfully, but these errors were encountered:
I got a version that checks if the dragsource / droptarget still exists. If not, it rejects the dnd. This surely can be improved upon, but for now it prevents all the PageExpiredExceptions.
However, I used my custom formatter to the format is a bit off and a pull-request will be ugly. Do you use a formatter (if so, which?) Then I'll create a pull-request.
Many thanks for your pull request. I've opted for a slightly simpler solution:
you can override DropTarget#onExpired() and just handle the PageExpiredException there.
I have quite a large application that centers around search. On the left, there is a dropzone (for facets) where items from a list can be dropped. When an item is dropped, a query is modified, an Ajax-refresh is done and the list is refreshed. This works great as long as the user has enough patienct to wait for the center-list to be re-rendered by the browser.
However, it is possible for the user to quickly drag-and-drop TWO items in quick succession from the center to the left. The first causes a refresh of the list, so the markup-id's are no longer valid. However, because the browser so not yet received the new center, there are still items that can be dragged. These items will have invalid markup-ids. When the user drops the second item on the dropzone, a
PageExpiredException
is thrown by theMarkupIdVisitor.getComponent()
in degetDrag()
of theDragSource
I think it would be nice if the transfer can be rejected if the original item no longer exists. Currently it is not possible to prevent this behaviour.
What do you think? Maybe there are better methods of dealing with this problem?
The text was updated successfully, but these errors were encountered: