2017-07-28 92 views
1

我使用PrimeFaces 5.2。p:微调框未显示

这些都是我的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

如何必须配置我的项目看到微调?

+0

请重新阅读您的标题,标签和问题并进行改进 – Kukeltje

+0

检查我的编辑...与您的原始编辑进行比较;-) – Kukeltje

回答

0

我想你应该阅读Primefaces中的微调文档。微调主要用于递增/递减输入文本的值。您还需要创建一个定义值的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}" /> 

希望它可以帮助!