【问题标题】:<p:lineChart> Tag Library supports namespace: http://primefaces.org/ui, but no tag was defined for name: lineChart<p:lineChart> 标签库支持命名空间:http://primefaces.org/ui,但没有为名称定义标签:lineChart
【发布时间】:2014-10-26 11:49:34
【问题描述】:

我想使用 primefaces 5.1 创建折线图。但我在加载我的 xhtml 页面时收到错误消息“ 标签库支持命名空间:http://primefaces.org/ui,但没有为名称定义标签:lineChart”。这是我的代码

sample.xhtml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>
<h:form>

 <p>LineChart is created By Manaf.</p>
    <p:lineChart id="linear" value="#{chartBean.linearModel}" legendPosition="e"          title="Linear Chart" minY="0" maxY="10" style="height:300px;"/>
    <p:lineChart id="category" value="#{chartBean.categoryModel}" legendPosition="e"title="Category Chart" minY="0" maxY="200" tyle="height:300px;margin-top:20px"/>

</h:form>
</h:body>
</html>

...实际问题是什么,我是primefaces和jsf的初学者...

【问题讨论】:

    标签: java jsf primefaces xhtml linechart


    【解决方案1】:

    当前的语法 (5.1) 是 ...

    <p:chart type="line" model="#{chartView.lineModel1}" style="height:300px;"/>
    

    【讨论】:

      【解决方案2】:

      检查您当前是否使用最新版本 5.1。访问PrimeFaces或查看 Maven 依赖:

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

      【讨论】:

        【解决方案3】:

        根据primefaces 6.2的文档:

        https://www.primefaces.org/docs/guide/primefaces_user_guide_6_2.pdf

         <p:chart type="line" model="#{bean.model}" />
        

        这些是存在的不同类型,并且每一种都可以定制或组合几种

        【讨论】:

        • 这与其他答案中尚未回答的问题有何关系?
        • 除了所有可能性之外,本例中还显示了具体示例
        猜你喜欢
        • 2012-09-18
        • 2018-12-15
        • 2018-08-12
        • 2017-11-28
        • 1970-01-01
        • 2017-04-17
        • 2016-04-09
        • 1970-01-01
        相关资源
        最近更新 更多