O'Reilly logo

PrimeFaces Cookbook - Second Edition by Oleg Varaksin, Mert Çalışkan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required