Restricting dropping by tolerance and acceptance

Droppable behavior is highly configurable. There are a lot of options to restrict dropping. They are useful in matching the draggable and droppable components more precisely.

In this chapter, we will meet options for tolerance and acceptance. We will take several h:panelGroup components and make them droppable with different tolerance and acceptance values.

How to do it...

Tolerance specifies which mode to use for testing if a draggable component is over a droppable target. There are four different tolerance modes. They can be chosen by the tolerance attribute of p:droppable. The following code snippet shows four h:panelGroup components with settings for tolerance:

<h:panelGrid columns="4"> <h:panelGroup ...

Get PrimeFaces Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.