jsf - p:toolbar 不显示,虽然其他元素工作正常
问题描述
我有下面的代码来显示一个编辑器和工具栏,不知何故工具栏没有显示,我只是得到一条大细线(屏幕截图中的黄色突出显示)。
我使用了这里的工具栏代码。
有人可以帮我指出这个问题吗,我搜索并看到 jquery 可能是问题,但我没有明确加载任何 jquery 或其他库。另外,我的编辑器工作正常,但工具栏不行。
<?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>
<h1>Hello World PrimeFaces</h1>
<h:form>
<p:editor></p:editor>
<br></br>
<p:toolbar>
<f:facet name="left">
<p:commandButton type="button" title="Save" icon="ui-icon-disk" />
<p:commandButton type="button" title="Delete" icon="ui-icon-trash" />
<p:commandButton type="button" title="Print" icon="ui-icon-print" />
</f:facet>
</p:toolbar>
</h:form>
</h:body>
</html>
解决方案
我克隆了 PrimeFaces 测试项目:https ://github.com/primefaces/primefaces-test
将您上面的确切代码输入到test.xhtml
.
然后我运行项目mvn clean jetty:run
并导航到http://localhost:8080/primefaces-test/test.xhtml
这是我的截图。
推荐阅读
- python - 解析大尺寸 xml 文件时内存已满等问题
- php - 将 Curl 响应转换为可用的 php 格式
- wpf - 如何设置子代理相对于 DataContext 的绑定?
- scala - 使用不可变集合的上限
- javascript - Discord.js 向用户添加角色警报
- powershell - 为什么''不匹配'\s*'
- node.js - 用于数据库插入和更新的 Nodejs 竞争条件
- asterisk - IVR Asterisk 拨号计划因无效按键而无限期
- django - 如何在数据库中存储 Django 表单的默认值?
- r - R:在“X11_MetricInfo”中无效使用 XX < 0