【问题标题】:How to hide messages with id javax_faces_developmentstage_messages如何隐藏 ID 为 javax_faces_developmentstage_messages 的消息
【发布时间】:2012-01-02 08:20:10
【问题描述】:

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

的属性

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

How to override default file upload h:message in ICEfaces

请指教,谢谢。

更新:

代码:

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

【问题讨论】:

标签: jsf-2 icefaces-2


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    我通过将新消息添加到 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;"/> 
    

    【讨论】:

      猜你喜欢
      • 2017-12-26
      • 2012-10-30
      • 2016-06-22
      • 1970-01-01
      • 2011-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多