1

I work with PrimeFaces 5.2.

These are my maven dependencies:

<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>5.2</version>
</dependency>

<dependency>
    <groupId>com.sun.faces</groupId>
    <artifactId>jsf-api</artifactId>
    <version>2.1.7</version>
</dependency>

<dependency>
   <groupId>com.sun.faces</groupId>
   <artifactId>jsf-impl</artifactId>
   <version>2.1.7</version>
</dependency>
    </dependencies>

I have the XHTML:

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <f:view contentType="text/html">
        <h:head />
        <h:body>
            <h:outputLabel>Name:</h:outputLabel>
             <h:form>
                <p:spinner />
            </h:form>             

        </h:body>
    </f:view>
</html>

The output screen is

enter image description here

How do I have to configure my project to see the spinner?

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Carlota
  • 1,239
  • 3
  • 29
  • 59

1 Answers1

1

I think you should read the documentation for a spinner in Primefaces. Spinner is primarily used to increment/decrement the value of input text. You also need to create a bean defining the setter/getter for the values.

Do have a look https://www.primefaces.org/showcase/ui/input/spinner.xhtml

Just for reference:

 <h:outputLabel for="basic" value="Basic Spinner: " />
    <p:spinner id="basic" value="#{spinnerView.number1}" />

Hope it helps!!