1 Reply Latest reply on Jun 6, 2007 6:24 PM by Hung Tang

    @Validator causing EntityHome.managed equal false

    Hung Tang Apprentice

      Does anyone know why throwing a ValidatorException in annotated @Validator classes would cause EntityHome.managed false? Other validation errors would not cause the managed property to be false except for those matched by @Validator classes. In the code I provide below, after you enter "false" in the input text box, the button update button would disappear upon refresh because the managed property is set to false.

      ## sheep.xhtml

       <f:facet name="afterInvalidField">
       <h:inputText value="#{sheepHome.instance.name}"
       <h:commandButton action="#{sheepHome.update}"

      ## sheep.page.xml
       <begin-conversation join="true"/>
       <param name="id" value="#{sheepHome.id}" converterId="javax.faces.Long"/>

      ## TestValidator.java
      public class TestValidator extends EntityController
       implements javax.faces.validator.Validator, Serializable {
       public void validate(FacesContext facesContext, UIComponent uiComponent, Object object) throws ValidatorException {
       if ("false".equals((String) object)) throw new ValidatorException(new FacesMessage("Managed is false"));