如何隐藏 ID 为 javax_faces_developmentstage_messages 的消息

发布于 2024-12-16 22:54:06 字数 684 浏览 1 评论 0原文

有时,我会在 xhtml 页面底部看到生成的信息消息(不是验证) id javax_faces_developmentstage_messages 我如何防止在特定页面中生成此类消息,我不想更改 javax.faces.PROJECT_STAGE 的属性,

当我尝试覆盖默认上传消息时,我正面临这样的问题在icefaces中的文件中,它显示了新消息和旧消息(即使在添加新消息之前使用clear),此处:

如何覆盖 ICEfaces 中的默认文件上传 h:message

指教,谢谢。

更新:

代码:

<ace:fileEntry id="fileEntryComp"
               label="File Entry"
               relativePath="uploaded"
               useSessionSubdir="false"
               fileEntryListener="#{myBean.listener}" /> 

sometimes, i see generated info messages (not validation) at bottom of xhtml pages
with id javax_faces_developmentstage_messages
how can i prevent such messages from being generated in a specific page, i don't want to change the attribute of javax.faces.PROJECT_STAGE

i am facing such issue exactly when trying to override default message for uploading file in icefaces it shows both the new and old message (even when using clear before adding the new message), here:

How to override default file upload h:message in ICEfaces

please advise, thanks.

UPDATE:

code:

<ace:fileEntry id="fileEntryComp"
               label="File Entry"
               relativePath="uploaded"
               useSessionSubdir="false"
               fileEntryListener="#{myBean.listener}" /> 

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

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

发布评论

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

评论(2

奶气 2024-12-23 22:54:06

我通过将新消息添加到 null clientId 解决了这个问题:

context.addMessage(null, new FacesMessage(message));

在视图中,我添加了:

<h:messages id="summary"  styleClass="summary" infoStyle="Color:blue;" errorStyle="Color:red;" fatalStyle="margin-right: 85%; Color:red;" globalOnly="true"/> 
<!-- i had to add the following one too -->     
<h:messages for="fileEntryComp" style="display:none;"/> 

i resolved it by adding the new messages to null clientId:

context.addMessage(null, new FacesMessage(message));

and in the view, i added:

<h:messages id="summary"  styleClass="summary" infoStyle="Color:blue;" errorStyle="Color:red;" fatalStyle="margin-right: 85%; Color:red;" globalOnly="true"/> 
<!-- i had to add the following one too -->     
<h:messages for="fileEntryComp" style="display:none;"/> 
妳是的陽光 2024-12-23 22:54:06

如果您想隐藏成功上传文件后生成的“'文件条目'上传成功'文件名'”消息,只需在视图中添加以下内容

<h:message for="fileEntryComp" infoStyle="display:none" /> 

if you want to hide " 'File Entry' uploaded successfully 'filename' " message which is generated after the successful upload of a file just add the following in your view

<h:message for="fileEntryComp" infoStyle="display:none" /> 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文