O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

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

Time for action – using the Spinner component

Let us see how we can use the Spinner component:

  1. Create a Spinner component to hold a double value, say price, that steps by 0.25 with the $ prefix:
    <p:spinner value="#{spinnerController.price}" prefix="$" stepFactor="0.25" />
  2. Create another Spinner component to hold a discount value with a % suffix and the discount value should be between 0 and 10:
    <p:spinner value="#{spinnerController.discount}" suffix="%" min="0" max="10" />

What just happened?

We have used the <p:spinner> component to create Spinner components with various features such as stepFactor, the min/max boundaries, and prefix/suffix.

What just happened?

However, ...

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