p:messages should extends UIMessages

UI Components for JSF
Post Reply
cilius
Posts: 9
Joined: 05 Jan 2011, 15:59

05 Jan 2011, 16:16

Hi

I would like to be able to verify at development time if a FacesMessage can be displayed(avoiding failing silently).

I'm doing this in a SystemEventListener listening for PreRenderViewEvent. But instead of testing for specific component library classes (like the primefaces message component that extends UIComponentBase) i would like to test on the components extending the UIMEssages component.

Is there a good reason for not extending the UIMessages component that i have missed?

N.B: It is the same situation with p:message that does not extend UIMessage.
PrimeFaces 3.2.RC1, Mojarra 2.1.4, JBoss EAP 5.1

Paul Dijou
Posts: 1
Joined: 08 Nov 2011, 23:54

09 Nov 2011, 00:05

Updating this question because I'm facing the same problem. I'm trying to use the UIInputContainer implemented by Seam Faces http://docs.jboss.org/seam/3/faces/refe ... tContainer and it works fine with h:message but, guess what, I want to use p:message because they are prettier. The problem is that the UIInputContainer parse only javax.faces.component.UIMessage on the JSF component tree as you can see (line 262 of the UIInpuntContainer class) :

Code: Select all

        } else if (component instanceof UIMessage) {
            elements.registerMessage((UIMessage) component);
        }
And because the org.primefaces.component.message.Message class doesn't extends javax.faces.component.UIMessage, p:message are not parsed and the application crash. Too bad...

Of course, one workaround would be to extends the UIInputContainer in order to add it the parsing of the org.primefaces.component.message.Message but it is not that easy since the class calls method on the UIMessage.

So, is it normal that the org.primefaces.component.message.Message does not extend javax.faces.component.UIMessage ? Same question for org.primefaces.component.messages.Messages and javax.faces.component.UIMessages ?

JSF version 2.0
Primefaces version : 3.0.M3
Seam Faces version : 3.1.0.Beta4

Thanks for your answer.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 45 guests