Primefaces 5.0的线条图未渲染
我最近升级到Primefaces 5.0,正在转换图表以适应5.0中的新图表api,这时我遇到了一个相当恼人的问题,我的一个折线图只拒绝在这一特定页面上呈现 更具体地说: 我的折线图在特定页面上不起作用 如果放在另一页上,图表就会工作 如果将其放在不工作的特定页面上,并且删除了所有其他内容,则仍然不工作 如果将图表放在特定页面和任何其他页面上,则两个页面上的图表都将起作用 -我所说的不工作是指页面上出现了一个大致与图表大小相同的空白区域,而不是正常显示。此外,导航到一个带有这个破损图表的视图会阻止我切换到其他页面,几乎就像一切都冻结了一样 我100%确信我的bean没有造成问题,因为我能够成功地创建图表,而不是在特定页面上 我已经花了10个多小时试图解决这个问题,但都无济于事。希望有人能找出问题所在 index.xhtml:Primefaces 5.0的线条图未渲染,primefaces,charts,render,linechart,Primefaces,Charts,Render,Linechart,我最近升级到Primefaces 5.0,正在转换图表以适应5.0中的新图表api,这时我遇到了一个相当恼人的问题,我的一个折线图只拒绝在这一特定页面上呈现 更具体地说: 我的折线图在特定页面上不起作用 如果放在另一页上,图表就会工作 如果将其放在不工作的特定页面上,并且删除了所有其他内容,则仍然不工作 如果将图表放在特定页面和任何其他页面上,则两个页面上的图表都将起作用 -我所说的不工作是指页面上出现了一个大致与图表大小相同的空白区域,而不是正常显示。此外,导航到一个带有这个破损图表的视图会阻
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Arbitrage Online: Member's Area</title>
<h:outputStylesheet library="css" name="layout.css"/>
<h:outputScript library="js" name="functions.js"/>
</h:head>
<h:body id="body" styleClass="body">
<p:layout fullPage="true" widgetVar="layoutWdgt">
<p:layoutUnit position="north" size="60" gutter="0" styleClass="headerArea">
<ui:include src="template/header.xhtml" />
</p:layoutUnit>
<p:layoutUnit position="west" size="278" gutter="0" styleClass="menuArea">
<ui:include src="template/menu.xhtml" />
</p:layoutUnit>
<p:layoutUnit position="center" gutter="0" styleClass="contentArea">
<h:panelGroup id="contentAreaPanel">
<ui:include src="#{navigationBean.pageName}.xhtml" />
</h:panelGroup>
</p:layoutUnit>
<p:layoutUnit position="south" size="47" gutter="0" styleClass="footerArea">
<p:outputPanel styleClass="copyright">Copyright © Arbitrage Online, 2014. All rights reserved.</p:outputPanel>
</p:layoutUnit>
</p:layout>
</h:body>
</html>
网上套利:会员区
版权所有©套利在线,2014年。版权所有。
menu.html:
<ui:composition
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<h:form id="menuForm">
<p:menu style="width:100%;" styleClass="leftMenu">
<p:menuitem value="Overview" onclick="selectMenuitemLink(this)" action="#{navigationBean.nagivate('template/overview')}" styleClass="ui-state-active" style="border-top: none !important;" icon="ui-icon-home24" update=":contentAreaPanel"/>
<p:menuitem value="Add Items" onclick="selectMenuitemLink(this)" action="#{navigationBean.nagivate('template/addAmazonItems')}" icon="ui-icon-home" update=":contentAreaPanel"/>
<p:menuitem value="Manage Items" onclick="selectMenuitemLink(this)" action="#{navigationBean.nagivate('template/manageAmazon')}" icon="ui-icon-disk" update=":contentAreaPanel"/>
<p:menuitem value="View eBay Results" onclick="selectMenuitemLink(this)" action="#{navigationBean.nagivate('template/manageEbay')}" icon="ui-icon-home" update=":contentAreaPanel"/>
<p:menuitem value="Manage Snipes" onclick="selectMenuitemLink(this)" action="#{navigationBean.nagivate('template/overview')}" icon="ui-icon-home" update=":contentAreaPanel"/>
<p:menuitem value="Manage Excludes" onclick="selectMenuitemLink(this)" action="#{navigationBean.nagivate('template/header')}" icon="ui-icon-home" update=":contentAreaPanel" />
<p:menuitem value="Submit a Ticket" onclick="selectMenuitemLink(this)" action="#{navigationBean.nagivate('template/header')}" icon="ui-icon-home" update=":contentAreaPanel" />
<p:menuitem value="View Tutorials" onclick="selectMenuitemLink(this)" action="#{navigationBean.nagivate('template/header')}" style="border-bottom: none !important;" icon="ui-icon-home" update=":contentAreaPanel" />
</p:menu>
</h:form>
</ui:composition>
它不工作的特定页面(manageAmazon.xhtml):
它工作的随机页面(overview.xhtml)。我对图表的代码做了一些修改,以便在此页面上对其进行测试,因为此页面没有(Amazonim)。执行此操作后,图表在此页上运行,但在另一页上仍然产生相同的问题:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
</ui:composition>
这是由于原始页面不包含图表造成的。只有基本的primefaces js被加载,这不包括图表js。因此,当您动态更改include时,它不会被加载。在这种情况下,手动添加它可以解决问题
实际上,这是在当前显示页面的应用程序启动时加载的,而不是在应用程序运行后有新页面时加载的。
希望这有帮助
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
</ui:composition>