Messages

Messages and Message components are highly customizable and pre-skinned versions of standard message components.

Messages

Message

Default: *
Text: *
Icon: *
Tooltip:

Source

<p:tooltip />
            
<h3>Messages</h3>	
<h:form id="form1">
    <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />

    <p:commandButton id="infoButton" value="Info" actionListener="#{messagesController.addInfo}"/>
    <p:commandButton id="warnButton" value="Warn" actionListener="#{messagesController.addWarn}"/>
    <p:commandButton id="errorButton" value="Error" actionListener="#{messagesController.addError}"/>
    <p:commandButton id="fatalButton" value="Fatal" actionListener="#{messagesController.addFatal}"/>
</h:form>

<h3>Message</h3>
<h:form id="form2">
    <h:panelGrid id="grid" columns="3" cellpadding="4">
        <h:outputText value="Default: *" />
        <p:inputText id="default" required="true" />
        <p:message for="default" />

        <h:outputText value="Text: *" />
        <p:inputText id="txt" required="true" />
        <p:message for="txt" display="text" />

        <h:outputText value="Icon: *" />
        <p:inputText id="icon" required="true" />
        <p:message for="icon" display="icon" />

        <h:outputText value="Tooltip:" />
        <p:inputText id="tt" required="true" />
        <p:message for="tt" display="tooltip" />
    </h:panelGrid>

    <p:commandButton id="submitButton" value="Submit" update="grid"/>
</h:form>