p:spinner未显示

时间:2017-07-28 19:26:50

标签: jsf primefaces spinner

我使用PrimeFaces 5.2。

这些是我的maven依赖项:

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

我有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>

输出屏幕

enter image description here

如何配置项目以查看微调器?

1 个答案:

答案 0 :(得分:0)

我认为你应该阅读Primefaces中微调器的文档。 Spinner主要用于递增/递减输入文本的值。您还需要创建一个定义值的setter / getter的bean。

看看https://www.primefaces.org/showcase/ui/input/spinner.xhtml

仅供参考:

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

希望它有所帮助!!

相关问题