primefaces 标签 <p:sidebar> 错误
primefaces tag <p:sidebar> error
我正在创建 JSF 网络应用程序,我试图在其中 运行 primefaces 官方网站的 p:sidebar 代码可用,但出现错误。
<p:sidebar>
Tag Library supports namespace: http://primefaces.org/ui
, but no tag was defined for name: sidebar
我正在使用 primefaces 6.0
我正在尝试的代码 运行
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
>
<h:head>
<title>carouselExample</title>
</h:head>
<h:body>
<p:sidebar widgetVar="sidebar1" baseZIndex="10000">
<h1 style="font-weight:normal">Left Sidebar</h1>
<p:commandButton value="Cancel" oncomplete="PF('sidebar1').hide()"/>
</p:sidebar>
<p:sidebar widgetVar="sidebar2" position="right" baseZIndex="10000">
<h1 style="font-weight:normal">Right Sidebar</h1>
<p:commandButton value="Cancel" oncomplete="PF('sidebar2').hide()"/>
</p:sidebar>
<p:sidebar widgetVar="sidebar3" position="top" baseZIndex="10000">
<h1 style="font-weight:normal">Top Sidebar</h1>
<p:commandButton value="Cancel" oncomplete="PF('sidebar3').hide()"/>
</p:sidebar>
<p:sidebar widgetVar="sidebar4" position="bottom" baseZIndex="10000">
<h1 style="font-weight:normal">Bottom Sidebar</h1>
<p:commandButton value="Cancel" oncomplete="PF('sidebar4').hide()"/>
</p:sidebar>
<p:sidebar widgetVar="sidebar5" fullScreen="true" baseZIndex="10000">
<h1 style="font-weight:normal">Full Screen Sidebar</h1>
<p:commandButton value="Cancel" oncomplete="PF('sidebar5').hide()"/>
</p:sidebar>
<p:commandButton icon="fa fa-arrow-right" oncomplete="PF('sidebar1').show()" />
<p:commandButton icon="fa fa-arrow-left" oncomplete="PF('sidebar2').show()" />
<p:commandButton icon="fa fa-arrow-down" oncomplete="PF('sidebar3').show()" />
<p:commandButton icon="fa fa-arrow-up" oncomplete="PF('sidebar4').show()" />
<p:commandButton icon="fa fa-arrows-alt" oncomplete="PF('sidebar5').show()" />
</h:body>
</html>
侧边栏目前仅在精英版本(6.1.7 和 6.0.25)或即将发布的 6.2 中可用,但尚未发布。
我正在创建 JSF 网络应用程序,我试图在其中 运行 primefaces 官方网站的 p:sidebar 代码可用,但出现错误。
<p:sidebar>
Tag Library supports namespace:http://primefaces.org/ui
, but no tag was defined for name: sidebar
我正在使用 primefaces 6.0
我正在尝试的代码 运行
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
>
<h:head>
<title>carouselExample</title>
</h:head>
<h:body>
<p:sidebar widgetVar="sidebar1" baseZIndex="10000">
<h1 style="font-weight:normal">Left Sidebar</h1>
<p:commandButton value="Cancel" oncomplete="PF('sidebar1').hide()"/>
</p:sidebar>
<p:sidebar widgetVar="sidebar2" position="right" baseZIndex="10000">
<h1 style="font-weight:normal">Right Sidebar</h1>
<p:commandButton value="Cancel" oncomplete="PF('sidebar2').hide()"/>
</p:sidebar>
<p:sidebar widgetVar="sidebar3" position="top" baseZIndex="10000">
<h1 style="font-weight:normal">Top Sidebar</h1>
<p:commandButton value="Cancel" oncomplete="PF('sidebar3').hide()"/>
</p:sidebar>
<p:sidebar widgetVar="sidebar4" position="bottom" baseZIndex="10000">
<h1 style="font-weight:normal">Bottom Sidebar</h1>
<p:commandButton value="Cancel" oncomplete="PF('sidebar4').hide()"/>
</p:sidebar>
<p:sidebar widgetVar="sidebar5" fullScreen="true" baseZIndex="10000">
<h1 style="font-weight:normal">Full Screen Sidebar</h1>
<p:commandButton value="Cancel" oncomplete="PF('sidebar5').hide()"/>
</p:sidebar>
<p:commandButton icon="fa fa-arrow-right" oncomplete="PF('sidebar1').show()" />
<p:commandButton icon="fa fa-arrow-left" oncomplete="PF('sidebar2').show()" />
<p:commandButton icon="fa fa-arrow-down" oncomplete="PF('sidebar3').show()" />
<p:commandButton icon="fa fa-arrow-up" oncomplete="PF('sidebar4').show()" />
<p:commandButton icon="fa fa-arrows-alt" oncomplete="PF('sidebar5').show()" />
</h:body>
</html>
侧边栏目前仅在精英版本(6.1.7 和 6.0.25)或即将发布的 6.2 中可用,但尚未发布。