0

I have a textbox where i have added two validator

<h:inputText value="#{genFeatCapacity.value}" required="#{genFeatCapacity.required}" requiredMessage="Please provide value for this field" >
<f:validateRegex pattern="#{genFeatCapacity.regPattern}|\\s*" />
<f:validateLongRange  minimum="#{genFeatCapacity.minLength}" 
 maximum="#{genFeatCapacity.maxLength}"/>
</h:inputText> 

Now how to add validation fail message for

  1. Regular-expression fail validation message?
  2. Range fail validation message?
  3. Regular-expression and Range both failed validation message?

In another answer given by @BalusC that can be achieve by Omnifaces ,but if we are not using Omnifaces its not possible in JSF2+. ?

Community
  • 1
  • 1
Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
  • 3
    OmniFaces is open source. Just look, copypaste and do the same. OmniFaces is not there for decoration, but to fill gaps in JSF (in other words it's simply not possible in standard JSF without a bit of extra code, exactly that code which is already collected by OmniFaces so you wouldn't need to copypaste all over and over). – BalusC Jan 29 '16 at 11:26
  • @BalusC Do you mean to use Omnifaces or i have to check how you implemented that feature in Omnifaces and i have to to do same in JSF2 as well. – Subodh Joshi Jan 29 '16 at 11:35
  • You can do it with writing own validator `` or bean validation. – vels4j Jan 29 '16 at 12:11
  • @vels4j: That was already answered in duplicate the OP found himself. Anyway, the current question doesn't make much sense after all. OmniFaces or not, code is just code. Whether it's homegrown, or copypasted, or provided by an external library. – BalusC Jan 29 '16 at 12:30
  • @BalusC you are right and OmniFaces is greate effort, well done. – vels4j Jan 29 '16 at 12:35

0 Answers0