3

How can I show all validation messages in one pop up using growl, because by default every validation message on the client side creates new pop up.

Of course I could do validation on the server side and send final message to the growl but is it possible to do it on the client side?

Some code goes here:

<p:dialog id="chPwD" header="#{res['user.passwordDialogHeader']}" widgetVar="changePwV" closeOnEscape="true" resizable="false">
    <p:growl id="growl" showDetail="false" life="3000" />
    <h:panelGrid id="chPwPG" columns="1" cellpadding="1" transient="true">
        <h:panelGrid id="chPwPGi" columns="2" cellpadding="1">
            <p:outputLabel for="pwd0" value="#{res['user.oldPassword']}" />
            <h:panelGroup>
                <p:password id="pwd0" label="#{res['user.oldPassword']}" value="#{mngr.oldPassword}" required="true" style="width:250px;"/>
                <span style="display:inline-block;"><p:message for="pwd0"/><p:messages for="pwd0"/></span>
            </h:panelGroup>

            <p:outputLabel for="pwd1" value="#{res['user.newPassword']}" />
            <h:panelGroup>
                <p:password id="pwd1" label="#{res['user.newPassword']}" value="#{mngr.newPassword}" match="pwd2" required="true" style="width:250px;"/>
                <span style="display:inline-block;"><p:message for="pwd1"/></span>
            </h:panelGroup>

            <p:outputLabel for="pwd2" value="#{res['user.repeatNewPassword']}" />
            <h:panelGroup>
                <p:password id="pwd2" label="#{res['user.repeatNewPassword']}" value="#{mngr.newPassword}" required="true" style="width:250px;"/>
                <span style="display:inline-block;"><p:message for="pwd2"/></span>
            </h:panelGroup>
        </h:panelGrid>
    </h:panelGrid>
    <f:facet name="footer">
        <p:commandButton value="#{res['btn.apply']}" style="margin-right:20px;" update=":chPwPG" action="#{mngr.changeSelectedUserPassword}" oncomplete="handlePwChangeRequest(xhr, status, args)"/>
        <p:commandButton value="#{res['btn.cancel']}" onclick="changePwV.hide();" type="button"/>
    </f:facet>
</p:dialog>
Tiny
  • 27,221
  • 105
  • 339
  • 599
Benas
  • 2,106
  • 2
  • 39
  • 66

1 Answers1

0

you should try <p:messages showDetail="false" showSummary="true"/> and it work for me.

wilson
  • 281
  • 6
  • 22