JSF using EL to test global messages presence

后端 未结 3 1565
[愿得一人]
[愿得一人] 2021-01-02 15:25

I\'m trying to display a block only if there are Global messages in the JSF Queue.

I tried to use rendered=\"#{not empty facesContext.getMessageList(null)}\"

3条回答
  •  执笔经年
    2021-01-02 15:54

    no need for custom EL function

    try this

    rendered="#{not empty facesContext.messageList}"
    

    EDIT

    Haven't tried it myself , but try

    rendered="#{not empty facesContext.messageList(null)}"
    

    An idea...

     rendered="#{not facesContext.validationFailed and not empty facesContext.messageList}"
    

提交回复
热议问题