PrimeFaces 10 HTML造型

发布于 2025-02-02 03:33:27 字数 518 浏览 2 评论 0原文

我想在PrimeFaces 10(emptymessage属性)中添加HTML样式消息。诸如“ Hello world!”之类的东西(请注意大胆的单词世界!)我将propertyResourceBundle带有message.properties属性文件来加载消息。我在Message.Properties中尝试了这样的事情:

grap.noData.text=Hello <b>world!</b>

但是它不起作用

<p:dataTable id="grapTable" var="row"
            value="#{grController.graphics}"
            emptyMessage="#{grController.editAllowed ? msg['grap.noData.text'] : msg['grap.noData.readOnly.text']}"></p:dataTable>

I want to add html styled message for empty datatable in Primefaces 10 (emptyMessage property). Something like "Hello world!" (notice bold word world!) I use PropertyResourceBundle with message.properties properties file to load message. I tried something like this in message.properties:

grap.noData.text=Hello <b>world!</b>

but it didn't work

<p:dataTable id="grapTable" var="row"
            value="#{grController.graphics}"
            emptyMessage="#{grController.editAllowed ? msg['grap.noData.text'] : msg['grap.noData.readOnly.text']}"></p:dataTable>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

草莓酥 2025-02-09 03:33:27

您可以使用emptymessage facet和seccape =“ false”这样的...

<f:facet name="emptyMessage">
  <h:outputText 
     escape="false" 
     value="#{grController.editAllowed ? msg['grap.noData.text'] : msg['grap.noData.readOnly.text']}" />
</f:facet>

You can do it instead with emptyMessage facet and escape="false" like this...

<f:facet name="emptyMessage">
  <h:outputText 
     escape="false" 
     value="#{grController.editAllowed ? msg['grap.noData.text'] : msg['grap.noData.readOnly.text']}" />
</f:facet>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文