Disable p:pickList vertical reordering via drag n drop?

UI Components for JSF
Post Reply
kwutzke
Posts: 201
Joined: 20 Jul 2012, 21:35

17 Apr 2014, 17:59

This is a followup thread to thread here:

http://forum.primefaces.org/viewtopic.php?f=3&t=23872

It's about not being able to disable vertical drag and drop in a picklist, while you can disable (hide) the buttons that do so.

Quoting from there:
You mean buttons? By the way, after 2 years of usage, you are the only one with this requirement so would like to learn why you are asking for this.
We're having the need for disabling drag n drop in a picklist in vertical direction only.

Being able to display the up and down buttons disables the ability to vertically sort via controls, however there's no way to disable this via drag and drop. The point is pretty much gone if you can still do so via drag and drop. :roll:

Example:

We have a list of parent items, where the children are displayed immediately following the parent object. On the UI (both sides) the structure looks like:

Compliance Rule (parent)
[ ] Compliance Rule - My Bad One
[ ] Compliance Rule - My Good One
[ ] Compliance Rule - What the Heck
Depots (parent)
[ ] Depots - Empty Ones
[ ] Depots - Orphaned Ones
Transactions (parent)
[ ] Transactions - Failed
[ ] Transactions - Succeeded

The [ ] simply represent a p:spacer 16x16 transparent icon rendered the left of the picklist entry, giving the illusion of a tree-like structure (2 levels only).

The problem is that the UI looks rather confusing when child items aren't displayed directly underneath their parents (we have icons for parent objects and the same for the children!). What we do on transfer now is to reorder the source and target lists, which works perfectly, but we cannot do this on vertical drag n drop actions... there's neither an event nor a "disable vertical reordering" attribute :|

The solution here would be to either disable vertical drag n drop via an attribute or offer a vertical drag n drop event (or both).

IMHO disabling the buttons is generally pointless when drag and drop can still be used.

Feature request posted here:

http://code.google.com/p/primefaces/iss ... il?id=6807

Thanks for listening :mrgreen:

Any comments appreciated.

PS: related issue here: http://forum.primefaces.org/viewtopic.php?f=3&t=16615
PrimeFaces 13, Mojarra 4.0, WildFly 31, Jakarta 10 + PrimeReact

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

17 Apr 2014, 19:31

For a workaround: if you look at the source of the picklist, and then especially the .js file (http://code.google.com/p/primefaces/sou ... icklist.js) , you'll see some 'move*' functions. If you override those, I'll bet the reordering stops working.

kwutzke
Posts: 201
Joined: 20 Jul 2012, 21:35

24 Apr 2014, 09:36

Thanks for pointing this out, but globally overriding the vertical drag and drop is out of the question. We need vertical reordering this for most (if not all!) other picklists in our webapp... :(

At minimum, we would need an "vertical reorder" event so that we can can reorder the items manually (as with on transfer). But then, the two attributes can probably be implemented more easily to not start the dragging process if set.

Karsten
PrimeFaces 13, Mojarra 4.0, WildFly 31, Jakarta 10 + PrimeReact

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

24 Apr 2014, 10:21

kwutzke wrote:Thanks for pointing this out, but globally overriding the vertical drag and drop is out of the question. We need vertical reordering this for most (if not all!) other picklists in our webapp... :(
I bet you can add a check in your (custom) move functions that looks for e.g. a specific class being present on the picklist and if not, use the normal behaviour.

kwutzke
Posts: 201
Joined: 20 Jul 2012, 21:35

12 May 2014, 17:44

Unfortunately this doesn't work. The move* methods are only invoked when using the button controls, but not via drag and drop (DnD).

I wonder where the DnD hooks are... Does anybody know?
PrimeFaces 13, Mojarra 4.0, WildFly 31, Jakarta 10 + PrimeReact

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests