On Tue, Apr 28, 2009 at 5:40 PM, Peter Dotchev <[email protected]> wrote:
> Setter methods of my business logic classes perform validation and throw > exceptions if given parameter is invalid. > I don't have separate methods for data validation. > In my wicket form I use CompoundPropertyModel which sets user entered > values directly in the business object. > If the user enters invalid value, the setter method throws some exception > and the error page is shown. > How can I intercept this exception and show the error message in a feedback > panel keeping the form open? > Hi, IMO isnt a great idea that your form directly modifies your business logic objects. You could use a pattern like Value Object. You modifies a Value Object and then updates your model with that Value Object. Cheers, -- Mauro Ciancio
