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
The OrderList component supports to reorder multiple items by pressing Ctrl and using the control buttons. This is a single reorder action but it produces a reorder event per item that was reorder in that action.
In my case this causes a bug. I've a p:ajax attached to the OrderList which handles the reorder event in a listener and validates, that the reorder action produced a valid result. If the result is invalid, the previous item list is recovered and the OrderList is updated. Additionally I create a faces message that notifies the user about that recovery.
The first reorder event produces the message and resets the list, while the second one is valid and won't update the list. The user gets no message (p:growl is used here which removes all messages, as the second message set is empty) but also a reset list.
Is it possible to change that behaviour, so that a single reorder action only produces a single reorder event? It should be enough to move $this.fireReorderEvent(); out of the nested functions and only fire it if really some items have been reordered.
The text was updated successfully, but these errors were encountered:
Basically I agree with you. But I would prefer to have it as it is and instead provide an ReorderEvent-Object with from/to-index set, so it's possible to really track the move. How maybe a combination with additional ReorderStart/Stop-Events?!
I've replicated the issue, I also expect one reorder event to be fired regardless of the number of selected items.
@hoax, that is a different case and more of an enhancement. org.primefaces.event.ReorderEvent has fromIndex and toIndex properties already but they are not used in OrderList.
Just a question (sorry): Won't it be better to also move the $this.saveState() to the if-block? Then it won't create the options each iteration, when only the last iteration will produce the final state.
The OrderList component supports to reorder multiple items by pressing Ctrl and using the control buttons. This is a single reorder action but it produces a reorder event per item that was reorder in that action.
In my case this causes a bug. I've a p:ajax attached to the OrderList which handles the reorder event in a listener and validates, that the reorder action produced a valid result. If the result is invalid, the previous item list is recovered and the OrderList is updated. Additionally I create a faces message that notifies the user about that recovery.
The first reorder event produces the message and resets the list, while the second one is valid and won't update the list. The user gets no message (p:growl is used here which removes all messages, as the second message set is empty) but also a reset list.
Is it possible to change that behaviour, so that a single reorder action only produces a single reorder event? It should be enough to move $this.fireReorderEvent(); out of the nested functions and only fire it if really some items have been reordered.
The text was updated successfully, but these errors were encountered: