如何为没有重复JSF的两个验证器显示相同的消息

时间:2016-11-28 05:14:33

标签: validation jsf jsf-2

我有两个不同输入的验证器,比如

<ui:include src="/validators/appSpecSubEntityDuplicateValidator.xhtml">
    <ui:param name="id" value="disbursementPaymentScheduledDateDuplicateValidator"/>
    <ui:param name="entityList" value="#{grantData.mainEntity.grantDisbursements}"/>
    <ui:param name="tempHolder" value="#{grantDisbursementSubForm.entity}"/>
    <ui:param name="fieldsList" value="#{['paymentScheduledDate']}"/>
    <ui:param name="isNew" value="#{grantDisbursementSubForm.isNew()}"/>
    <ui:param name="message" value="This Disbursement already exist."/>
    <ui:param name="process" value="#{not empty param[grantDisbursementSaveButton.clientId]}"/>
</ui:include>

<ui:include src="/validators/appSpecSubEntityDuplicateValidator.xhtml">
    <ui:param name="id" value="disbursementPaymentNumberDuplicateValidator"/>
    <ui:param name="entityList" value="#{grantData.mainEntity.grantDisbursements}"/>
    <ui:param name="tempHolder" value="#{grantDisbursementSubForm.entity}"/>
    <ui:param name="fieldsList" value="#{['paymentNumber']}"/>
    <ui:param name="isNew" value="#{grantDisbursementSubForm.isNew()}"/>
    <ui:param name="message" value="This Disbursement already exist."/>
    <ui:param name="process" value="#{not empty param[grantDisbursementSaveButton.clientId]}"/>
</ui:include>

当两个输入都不正确时,它会显示两条带有相同文本的消息。 我想显示只有一个。请帮帮我...谢谢!

0 个答案:

没有答案