[jboss-user] [JBoss Seam] - Re: How to write a validator that compares two fields

chawax do-not-reply at jboss.com
Mon Oct 15 03:31:11 EDT 2007


"pete.muir at jboss.org" wrote : It would be interesting to see if you can generalize this approach a bit to produce a validator that can work with two fields....

Well, that's what my validator does : it compares the value of the field with the value of an other field. The name of this other field is given by the attribute "compareTo". Maybe the name of this attribute is not well choosed ?

I made similar validators for greaterThan, lessThan, greaterThanOrEquals, lessThanOrEquals, but I have not completely finished them. 

I also think about supporting EL expressions in compareTo attribute, so that you can compare the value of the field with an attribute of a Seam component. But I don't really know how to do this ... Is there an example for this somewhere ?

When all will be finished, no problem for me to give the source code to the community ;)

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

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



More information about the jboss-user mailing list