Hello Thomas, You need some kind of model validation, where you validate the complete class (when all proeprties are filled in).
You can do it with a Bean Validation constraint (put it on the class level) or a Custom ExtVal constraint (also on class level) If you need more help, let us know. Regards -- Rudy De Busscher http://www.c4j.be On 16 November 2011 17:20, Thomas Andraschko <[email protected]> wrote: > Hi, > > i have some input fields for an entity and i want to check if the entered > name does already exist. > So i tried to create an BV constraint for the name property but i also need > the parent entity object (for checking if the entity is transient or not). > In a BV validator i can't get the the parent entity - so it's useless. > The other idea was to attach it on bean property level for the entity: > > @UniqueName > private Entity entity. > > <p:inputText value=#{myBean.entity.name <http://bean.entity.name/>}" /> > > But this wont validate the entity. > I thought about an custom converter and binding the #{bean.entity}. > The problem is, in getAsObject i must load the entity by the name and the > bean.entity will be overwritten. Or not? > > How can i prevent that the #{bean.entity} will be overwritten? > Is there another solution for validate the entity? > > I also use CODI and ExtVal. > > Thanks! > > Best regards, > Thomas >

