0

I get a null value when I pass a constant obtained with o:importConstants to an o:validator even when they both seems to be accessible on render time.

public class Test {
  public static final String PATTERN = "\\d+";
}

The constant value is obtained correctly cos I can print it:

<o:importConstants type="Test"/>
Pattern is: #{Test.PATTERN}
<p:password id="password" value="#{password}">
  <o:validator validatorId="javax.faces.RegularExpression" pattern="#{Test.PATTERN}"/>
</p:password>

When I check pattern variable in RegexValidator, it's null.

I tried also using f:attribute with a custom validator and checked these posts but without success (BalusC, help! :) :

Cœur
  • 37,241
  • 25
  • 195
  • 267
Aníbal
  • 785
  • 8
  • 24
  • Which OmniFaces version? This has been fixed since 2.1 and still works for me in 2.3 snapshot. – BalusC Mar 29 '16 at 17:08
  • I see, omnifaces 1.12, cos we are using old myfaces 2.1.12 and primefaces 3.5. Any idea then? – Aníbal Mar 29 '16 at 17:50
  • 1
    All fixes in 2.1 are backported to 1.11, so it should work in 1.11 and newer too. Perhaps there's more into the code? Everything works fine for me when I copypaste the exact snippet into `` of a templateless test file. – BalusC Mar 29 '16 at 18:56

0 Answers0