[richfaces-issues] [JBoss JIRA] (RF-12031) rich:validator does not work after re render (ajax)

Lukáš Fryč (JIRA) jira-events at lists.jboss.org
Tue Oct 16 05:42:02 EDT 2012


     [ https://issues.jboss.org/browse/RF-12031?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukáš Fryč updated RF-12031:
----------------------------

    Workaround Description: 
*New workaround:*

Use {{<a4j:ajax />}} instead of {{<f:ajax />}}.


*Old version of workaround (deprecated):*

1. Be sure to use SessionScoped Managed Bean.
2. add _<a4j:ajax event="blur" render="mytest2" />_ to the input
3. so the example will finally look like:
{code:xml}
<h:form id="dummyForm" prependId="false">
	<h:commandButton value="Toggle" actionListener="#{profileBean.toggleRender}">
	   <f:ajax execute="@form" render="@form" />
         </h:commandButton>
 
	 <h:panelGroup rendered="#{profileBean.mustRenderThePanel}">
           <br />
           <h:inputText id="mytest2" value="#{profileBean.firstName}">
	      <rich:validator />
	      <a4j:ajax event="blur" render="mytest2" />
	   </h:inputText>
	   <rich:message for="mytest2" />
         </h:panelGroup>
</h:form>
{code}

  was:
1. Be sure to use SessionScoped Managed Bean.
2. add _<a4j:ajax event="blur" render="mytest2" />_ to the input
3. so the example will finally look like:
{code:xml}
<h:form id="dummyForm" prependId="false">
	<h:commandButton value="Toggle" actionListener="#{profileBean.toggleRender}">
	   <f:ajax execute="@form" render="@form" />
         </h:commandButton>
 
	 <h:panelGroup rendered="#{profileBean.mustRenderThePanel}">
           <br />
           <h:inputText id="mytest2" value="#{profileBean.firstName}">
	      <rich:validator />
	      <a4j:ajax event="blur" render="mytest2" />
	   </h:inputText>
	   <rich:message for="mytest2" />
         </h:panelGroup>
</h:form>
{code}


    
> rich:validator does not work after re render (ajax)
> ---------------------------------------------------
>
>                 Key: RF-12031
>                 URL: https://issues.jboss.org/browse/RF-12031
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-validators
>    Affects Versions: 4.2.0.Final
>         Environment: browsers: Firefox, Chrome
>            Reporter: Andries Ehlers
>            Assignee: Lukáš Fryč
>            Priority: Minor
>             Fix For: 4.3.0.M2
>
>
> When you have a simple inputText component with rich:validator inside, validation works perfectly when you move focus away from the component - validation messages display, e.g:
> {code:xml|borderStyle=solid}
> <h:inputText id="mytest1" value="#{profileBean.profileUser.firstName}">
>   <rich:validator/>
> </h:inputText>
> <rich:message for="mytest1"/>
> {code}
> If the above code resides in a panel, which is conditionally rendered, then <rich:validator> ceases to function when you re-render the panel with ajax, eg:
> {code:xml|borderStyle=solid}
> <h:form id="dummyForm" prependId="false">
>   <h:commandButton value="Toggle" actionListener="#{profileBean.toggleRender}">
>      <f:ajax execute="@form" render="@form"/>
>   </h:commandButton>
>   <!--This will toggle on/off as you click the button above-->				
>   <h:panelGroup layout="block" rendered="#{profileBean.mustRenderThePanel}">
>     <br/>
>     <h:inputText id="mytest1" value="#{profileBean.profileUser.firstName}">
>    	<rich:validator/>  <!--this fails to work when you move focus away -->
>     </h:inputText>
>     <rich:message for="mytest1"/>
>   </h:panelGroup>
> </h:form>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the richfaces-issues mailing list