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

Brian Leathem (JIRA) issues at jboss.org
Mon Mar 31 20:03:12 EDT 2014


    [ https://issues.jboss.org/browse/RF-12031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12957217#comment-12957217 ] 

Brian Leathem edited comment on RF-12031 at 3/31/14 8:01 PM:
-------------------------------------------------------------

Currently we are facing the same issue using RF 4.3.5.

We tried the workaround as described here, but have a few problems we'd like to share.

For inputText adding:

{code}
   <a4j:ajax event="blur" render="<input-id>" />
{code}

seems to work at first, but has some backdraws.

Adding this seems to produce 2 JS handlers to execute.The first one (onchange) fails due to the missing JS-function "av_....", while the other performs the validation correctly. (This can be verified when looking at the output of firebug for example.)
A bit ugly but somewhat OK. - However combining this workaround with <rich:focus preserve="true" /> inside the form leads to a validation error message showing for a moment and then disappearing again directly after. The validation message will only remain visible when defining the workaround with the additional limitRender="true" attribute and also adding the id of the message for this field to the render attribute.

Another problem is, that this workaround is only valid for inputText fields. Currently we are facing the same problem for example with the rich:calendar component having a rich:validator. 

This is reproducable with the same configuration as shown in the description of this JIRA. - After the page was loaded via ajax re-render, perform a click on the select date button. Try to select a day. Normally the selected date is validated, the selector pop-up closes and the value is applied to the input field of the calendar. In this case the selector pop-up is not closed automatically. Again this problem is due to the missing JS-function "av_...." as can be seen also in firebug.
We've tried several of the ajax event handlers of the calendar component to find a similar workaround like the one for inputText, but with no success so far.

We still have to check that assumption, but I guess the same problem will occur for other field types like rich:select as well...

Our current project heavily relies on ajax re-rendering and using the rich:validator as bridge for client side validation and thus this issue is becoming a show-stopper for us.

Therefore, please re-open this issue! Any hint for finding a suitable workaround for other components besides inputText would also be greatly appreciated!

Update:
After a little more research I found an old JIRA from 2011
https://issues.jboss.org/browse/RF-10940

... as well as a discussion about what seems to be the problem
https://community.jboss.org/thread/171420

Since it looks as if the problem was fixed back then (?!) could this be re-appearing in RF 4.3.5 for some reason?



                
      was (Author: michaelb80):
    Currently we are facing the same issue using RF 4.3.5.

We tried the workaround as described here, but have a few problems we'd like to share.

For inputText adding 
   <a4j:ajax event="blur" render="<input-id>" />
seems to work at first, but has some backdraws.

Adding this seems to produce 2 JS handlers to execute.The first one (onchange) fails due to the missing JS-function "av_....", while the other performs the validation correctly. (This can be verified when looking at the output of firebug for example.)
A bit ugly but somewhat OK. - However combining this workaround with <rich:focus preserve="true" /> inside the form leads to a validation error message showing for a moment and then disappearing again directly after. The validation message will only remain visible when defining the workaround with the additional limitRender="true" attribute and also adding the id of the message for this field to the render attribute.

Another problem is, that this workaround is only valid for inputText fields. Currently we are facing the same problem for example with the rich:calendar component having a rich:validator. 

This is reproducable with the same configuration as shown in the description of this JIRA. - After the page was loaded via ajax re-render, perform a click on the select date button. Try to select a day. Normally the selected date is validated, the selector pop-up closes and the value is applied to the input field of the calendar. In this case the selector pop-up is not closed automatically. Again this problem is due to the missing JS-function "av_...." as can be seen also in firebug.
We've tried several of the ajax event handlers of the calendar component to find a similar workaround like the one for inputText, but with no success so far.

We still have to check that assumption, but I guess the same problem will occur for other field types like rich:select as well...

Our current project heavily relies on ajax re-rendering and using the rich:validator as bridge for client side validation and thus this issue is becoming a show-stopper for us.

Therefore, please re-open this issue! Any hint for finding a suitable workaround for other components besides inputText would also be greatly appreciated!

Update:
After a little more research I found an old JIRA from 2011
https://issues.jboss.org/browse/RF-10940

... as well as a discussion about what seems to be the problem
https://community.jboss.org/thread/171420

Since it looks as if the problem was fixed back then (?!) could this be re-appearing in RF 4.3.5 for some reason?



                  
> 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
>
> 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