2 Replies Latest reply on Jul 12, 2011 8:52 AM by iabughosh

    bean validation and reset issue

    iabughosh Master

      Dear fellows,

      I've the following issue with bean validation (rich:graphValidator and f:beanValidation), lets assume the I have two fields f1 and f2, and the bean properties are p1 and p2, both of p1 and p2 are constrained with bean validation annotations (lets assume the constrains is @NotEmpty), in the edit mode i get the values from the database and put it into p1 and p2 (for ex : p1="value1" & p2="value2"), now lets make the scenario :

      1-delete p1 value and make it empty and change p2 value to value 3 (p1="" and p2="value3")

      2-press save button, validation get fired and shows the error message (p1 must not be empty).

      3-press reset button, get the values from db and put them into p1 and p2 (p1="value1" p2 ="value2")

      4- the values in the text field are (f1="value1" & f2="value3") .

       

       

      I override the clone method for my bean & I traced the values in my bean in the debug mode but in my page f1 value doesn' render, I've tried to make the render attribute points to my form but no changes.

       

       

      my walkaround : i was calling the reset method with actionListener now I'm using action with faces-navigation return attribute to the same page (return null doesn't work).

       

      my enviroment :

      JDK 1.6

      Tomcat 6

      JSF 2.1

      Rich 4

       

      thanks in advance.