Primefaces mobile and client side validation doesn't work

UI Components for JSF
Post Reply
Posts: 1
Joined: 25 May 2017, 22:03

08 Jul 2017, 10:19

Hello everybody,

I'm developing a mobile web app with Primefaces and want to integrate a client side validation but it doesn't work. It seems that the mobile render kit is not compatible with it or maybe I forgot to do something. Could anyone help me ? Thank you in advance.

The problem is when I use :





validateClient="true" attribute,

client side validation script is not called and the page is automatically refreshed after I click the commandButton even if ajax is enabled.

In the web browser I have this java script error once a page is loaded :

validators.js;jsessionid=1409a4a5b3f93be1b8d3134bfcce:1 Uncaught TypeError: Cannot set property 'custom.emailValidator' of undefined
at validators.js;jsessionid=1409a4a5b3f93be1b8d3134bfcce:1

ALL WORKS FINE WITHOUT ANY ERRORS when I remove <default-render-kit-id>PRIMEFACES_MOBILE</default-render-kit-id>

This is my sign_in.xhtml : (for the javascript and EmailValidator I copied example code from the Primefaces Showcase)

I include multiple pm:pages in one page.

<ui:composition xmlns=""

<pm:page id="sign_in">
<h1 id="kie_title" align="center">KIE</h1>

<h:form id="form_sign_in">
<p:messages id="messages" autoUpdate="true" globalOnly="true"/>

<p:panelGrid columns="1">
<p:outputLabel for="email" value="Email"/>
<p:inputText id="email" value="#{}" required="true">
<!--<f:validateRegex pattern="[a-zA-Z]*"/>-->
<f:validator validatorId="custom.emailValidator"/>
<p:message for="email"/>

<p:panelGrid columns="1">
<p:outputLabel for="password" value="Password"/>
<p:password id="password" value="#{signInCtrl.password}" required="true"/>
<p:message for="password"/>

<p:commandButton id="cmdbtn_sign_in" value="Sign In" action="#{signInCtrl.signIn()}" validateClient="true"

<!--Block fixed to the bottom of the page with New user and Forgot password links-->
<div id="new_user">
<p:button outcome="pm:sign_up?transition=slide" value="Sign Up"/>
<p:link outcome="pm:password_recovery?transition=slide" value="Forgot your password ?"/>

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 7 guests