[jboss-user] [JBoss Seam] - Re: Problem: Custom validate methods in EJBs crash

raja05 do-not-reply at jboss.com
Fri Sep 1 00:11:09 EDT 2006


"bfo81" wrote : 
  | But when you create a new person all its properties are null. And when you fill in the fields in a form and click save, then the persons properties are still null during validation (phase 3). They get their concrete values later, in phase 4 (update model values). And, alas, you cannot compare something to null.
  | 

Take a look at the ModelValidator class in org.jboss.seam.ui. That does its validation at the process Validation phase by using the model class (and the validators that go along with it) and the values that are in the request. 

One other way is that since the values are updated in the model only later(after the processValidations), you could queue a new type of event and set the phaseid of that to be UPDATE_MODEL_VALUES. That way the event will be queued during validations but will only be processed after the model values are updated. Thats still ugly(as you are validating in a phase thats not meant for that ) but will work.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968824#3968824

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968824



More information about the jboss-user mailing list