myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dora Rajappan (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (MYFACES-4156) Myface is not showing the FacesMessage after validation when ValidatorException is thown.
Date Mon, 25 Sep 2017 10:22:01 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-4156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16178819#comment-16178819
] 

Dora Rajappan commented on MYFACES-4156:
----------------------------------------

I used a method of the backing bean to validate the input Text submitted form via ajax. 
I followed your custom validator example also with ajax submit.

I got no message at client side. I got below response of view state. I have two forms in a
page and hence submitting via ajax.

<?xml version="1.0" encoding="UTF-8"?><partial-response id="j_id__v_0"><changes><update
id="j_id__v_0:javax.faces.ViewState:1"><![CDATA[rcmyCbYi6m38SUGtCwcBXuZ8YEleJQhP2PkK5T/zb2l5hxY8yut6o2TWaCnhzO1kE3gxtp65RYqKSWCxaSJb/+1zgjs4shm3L24b0Orc5odj5J4QC1YBFSHsCthxdqM8dgk72oY2gK7sxdySn1wjRjLNnfI6Ms8WmEUXKp6p5xnpI9R42jWNsz2NOUEdnYG4aWJD2aogjcLS0NxXFL35LZMaqpFg2qtn7cXeZYPumeFM4rwVrHPEOA1+CIGKw/eIrhlVOYkh99u4nyBPkfAVrYHAUbvZf/8c/vCc7IzSez2uFbxT59woBGhFTOd9TIp0Arj6Rcpf5p3lTxzKbBfdg15OCDl1cPGW0EiXx9jHAHWKNA8pmUPKb/KucrIo+ZzahEMQnLy4qG9CH/e+9r2cR8dbqpZ6BLrthF7TOrcyWyRll/kXNFYyakh6q6lBdERcfA3pOSbMBjcyA0KYDvGAlm1Nc/W2Pyc5ZNhJ1Xvk4chmTOyc1YfYlx5vFS7IWnofdUTOIBgADQfU9gsIMntsyGTGU2ge/CRrNhMnKm4YIfwA7tOIm/U80gwzRTI+b8/xj3YZ2YpqLEPU9VMo5gWrV2OyJOmbqtlYDX4IgYrD94ib5lWWwIh/lYilfUC7i4H9FYCMUqcyLRlIFYL7BjFAM6LvCw5IGi1Z0KY6+mV/UrITI6zkQhwIs/2Qc2rqW3PdijKz6eX4E6DgoftNTylXi8oLfHduEogKvMS6yNIBqwjZkfL2ViLt1myw8a4BI7IKqyisw6k0xAXOJoz2YfJWAVAZgVe8AZ3f2XfgyDT/eOadB3x2QVmIMMBbYHHN4i6EC4vWjE0KxotDoCD30nu7gtTVLRAhplkvMi9te86TjEGc2lCfYMzpcrcU/bUjIN4CJX3gCxnQsaRbt2uuBe8XiqLYfenbId2cXviPdQ==]]></update></changes></partial-response>

 <h:form id="helloForm">
    <h:panelGroup style="display:block; text-align:right">
    <h:outputLabel value ="Sign In"></h:outputLabel>
      <br/>   
      <br/>  	
      <h:outputLabel value ="User Id :"></h:outputLabel>
      <h:inputText type="text" id="userId" value="#{userBean.name}" validator="blub"/>
      
      <h:outputLabel value ="   Password :"></h:outputLabel>  
	  <h:inputSecret type="text" id="password" value="#{userBean.password}" validator="#{userBean.validatePassword}"/>

      
      <br/>
      
      <br/>
      <h:commandButton type="submit" id="submit"  action="#{userBean.success}" actionListener="#{userBean.login}"
value="Login" >
       <f:ajax event="click" execute="helloForm"/>   
      </h:commandButton>

> Myface is not showing the FacesMessage after validation when ValidatorException is thown.
> -----------------------------------------------------------------------------------------
>
>                 Key: MYFACES-4156
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4156
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.3.0-beta
>            Reporter: Dora Rajappan
>
> Myfaces 2.3 is not showing the FacesMessage after validation when ValidatorException
is thrown. Same works with mojarra 2.2.
> if (param.length() > 32) {
> 		          FacesMessage msg = new FacesMessage("Username should not exceed 32");
> 		          
> 		          throw new ValidatorException(msg);
> 		      }



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message