I've got a gernic data model which uses validators based on the Java Functional Interfaces. Every kind of data is validate correct, but when I use the client side validation I've got strange results as you can see below.
1. Validator is called in both ways, validation error is correct.
2. With client side validation enabled, the i18n is not done. (I use a javax.faces.validator.ValidatorException from the Validator for this) Looks like it just shows default messages.
3. With client side validation enabled, the message is shown in every p:message tag for every input component.
Without PF Client Side Validation:
With PF Client Side Validation:
Example PF code of the composite component:
Code: Select all
...
<p:outputLabel
id="lbl_inpIntegerProperty"
rendered="#{cc.attrs.propertyHelper.isIntegerInput(cc.attrs.propertyConstraint)}"
value="#{cc.attrs.propertyConstraint.name}"
for="inp_inpIntegerProperty"
title="" />
<p:inputNumber
id="inp_inpIntegerProperty"
rendered="#{cc.attrs.propertyHelper.isIntegerInput(cc.attrs.propertyConstraint)}"
required="#{cc.attrs.required}"
requiredMessage="#{i18NHelper.translateValidation('contraintType0')}"
disabled="#{cc.attrs.disabled}"
styleClass="defaultInputBox"
validator="#{cc.attrs.propertyHelper.getValidator(cc.attrs.propertyConstraint, i18NHelper).validate}"
value="#{cc.attrs.value}"
thousandSeparator="."
decimalPlaces="0"
title="" />
<p:messages
id="msg_inpIntegerProperty"
rendered="#{cc.attrs.propertyHelper.isIntegerInput(cc.attrs.propertyConstraint)}"
showIcon="false"
for="inp_inpIntegerProperty"
styleClass="defaultMessages" />
<p:outputLabel
id="lbl_inpDoubleProperty"
rendered="#{cc.attrs.propertyHelper.isDoubleInput(cc.attrs.propertyConstraint)}"
value="#{cc.attrs.propertyConstraint.name}"
for="inp_inpDoubleProperty"
title="" />
<p:inputNumber
id="inp_inpDoubleProperty"
rendered="#{cc.attrs.propertyHelper.isDoubleInput(cc.attrs.propertyConstraint)}"
required="#{cc.attrs.required}"
requiredMessage="#{i18NHelper.translateValidation('contraintType0')}"
disabled="#{cc.attrs.disabled}"
styleClass="defaultInputBox"
validator="#{cc.attrs.propertyHelper.getValidator(cc.attrs.propertyConstraint, i18NHelper).validate}"
value="#{cc.attrs.value}"
thousandSeparator="."
decimalSeparator=","
decimalPlaces="2"
title="" />
<p:messages
id="msg_inpDoubleProperty"
rendered="#{cc.attrs.propertyHelper.isDoubleInput(cc.attrs.propertyConstraint)}"
showIcon="false"
for="inp_inpDoubleProperty"
styleClass="defaultMessages" />
...
Lars