You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org> on 2012/09/19 18:37:08 UTC

[jira] [Comment Edited] (MYFACES-3611) Validator method fired N times for ajax action if there's a binding attribute

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

Mike Kienenberger edited comment on MYFACES-3611 at 9/20/12 3:36 AM:
---------------------------------------------------------------------

You might also be able to return null in controles.getTextComponent() and accomplish the same thing without having to make another bean or change scope.   My guess is that you only want a reference to the component, and you are not trying to create a new component.

public UIComponent getTextComponent() { return null; }

http://drewdev.blogspot.com/2009/01/jsf-component-binding-stinks.html

                
      was (Author: mkienenb):
    You might also be able to return null in controles.getTextComponent() and accomplish the same thing.   My guess is that you only want a reference to the component, and you are not trying to create a new component.

public UIComponent getTextComponent() { return null; }

http://drewdev.blogspot.com/2009/01/jsf-component-binding-stinks.html

                  
> Validator method fired N times for ajax action if there's a binding attribute
> -----------------------------------------------------------------------------
>
>                 Key: MYFACES-3611
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3611
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.1.2
>         Environment: Tomcat 7, windows
>            Reporter: Ricard Moré
>
> There's a problem in the validation phase when you mix ajax action and a binding value in the same form. For example I have this simple form:
> <h:form id="form">
> 	<h:inputText id="text" value="#{controles.text}" validator="#{controles.validateText}" 
> 	binding="#{controles.textComponent}"/>		
> 	<br/><br/>
> 	<h:commandButton value="validate">
> 		<f:ajax event="click" render="text" listener="#{controles.clearText}" execute="@form" immediate="false"/>
> 	</h:commandButton>
> </h:form>
> And when validate button is clicked the validator method validateText is called twice the first time, 3 times for the second submit and one more time each time the ajax action is fired.

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