Re: How to validate an entire object in a form (rather than a particular property of that object)
ok, thanks ... that worked. It threw up a different problem, but that'll be another post. Dan On 20/04/2010 01:53, Igor Vaynberg wrote: you can override form.onvalidate() and do your validation there -igor On Mon, Apr 19, 2010 at 4:51 PM, Dan Haywood dkhayw...@gmail.com mailto:dkhayw...@gmail.com wrote: Hi Pedro, but my problem is that there is no form component to represent the form itself, is there? Any other thoughts? Dan On 19/04/2010 20:27, Pedro Santos wrote: Hi Dan On Mon, Apr 19, 2010 at 2:04 PM, Dan Haywood dkhayw...@gmail.com mailto:dkhayw...@gmail.com wrote: Another form-related question. I can see how to install a validator on a Form - Form#add(IFormValidator) - but it seems that AbstractFormValidator, the adapter, always requires a specific FormComponent to be specified in its error(...) method. How does one raise an error on the state of the form (and by implication, that of the underlying domain object) itself, without having to specify any form component? FeedbackMessages API, is expection an Component object as reporter. Maybe add the validation error to the form component will make sense: formComponent.getForm().error( theValidationErrorNotFormComponentSpecific ) An example would be the classic fromDate endDate. A workaround would be to install the validator on - say - the endDate. But I'm after a general solution, rather than a solution for this particular example. Thanks Dan -- Dan Haywood consultant, mentor, developer, author agile, ddd, oo, java, .net, sybase MA, MBCS, CITP, CEng /mail: /d...@haywood-associates.co.uk mailto:d...@haywood-associates.co.uk /phone: /+44 (0)7961 144286 /book: /Domain Driven Design using Naked Objects http://pragprog.com/titles/dhnako /blog: /http://danhaywood.com /linked in: /http://uk.linkedin.com/in/dkhaywood /twitter: /http://twitter.com/dkhaywood /sybase: /http://sybtraining.co.uk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org mailto:users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org mailto:users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org mailto:users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org mailto:users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to validate an entire object in a form (rather than a particular property of that object)
Another form-related question. I can see how to install a validator on a Form - Form#add(IFormValidator) - but it seems that AbstractFormValidator, the adapter, always requires a specific FormComponent to be specified in its error(...) method. How does one raise an error on the state of the form (and by implication, that of the underlying domain object) itself, without having to specify any form component? An example would be the classic fromDate endDate. A workaround would be to install the validator on - say - the endDate. But I'm after a general solution, rather than a solution for this particular example. Thanks Dan -- Dan Haywood consultant, mentor, developer, author agile, ddd, oo, java, .net, sybase MA, MBCS, CITP, CEng /mail: /d...@haywood-associates.co.uk mailto:d...@haywood-associates.co.uk /phone: /+44 (0)7961 144286 /book: /Domain Driven Design using Naked Objects http://pragprog.com/titles/dhnako /blog: /http://danhaywood.com /linked in: /http://uk.linkedin.com/in/dkhaywood /twitter: /http://twitter.com/dkhaywood /sybase: /http://sybtraining.co.uk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to validate an entire object in a form (rather than a particular property of that object)
Hi Dan On Mon, Apr 19, 2010 at 2:04 PM, Dan Haywood dkhayw...@gmail.com wrote: Another form-related question. I can see how to install a validator on a Form - Form#add(IFormValidator) - but it seems that AbstractFormValidator, the adapter, always requires a specific FormComponent to be specified in its error(...) method. How does one raise an error on the state of the form (and by implication, that of the underlying domain object) itself, without having to specify any form component? FeedbackMessages API, is expection an Component object as reporter. Maybe add the validation error to the form component will make sense: formComponent.getForm().error( theValidationErrorNotFormComponentSpecific ) An example would be the classic fromDate endDate. A workaround would be to install the validator on - say - the endDate. But I'm after a general solution, rather than a solution for this particular example. Thanks Dan -- Dan Haywood consultant, mentor, developer, author agile, ddd, oo, java, .net, sybase MA, MBCS, CITP, CEng *mail: * d...@haywood-associates.co.uk *phone: *+44 (0)7961 144286 *book: *Domain Driven Design using Naked Objects http://pragprog.com/titles/dhnako *blog: *http://danhaywood.com *linked in: *http://uk.linkedin.com/in/dkhaywood *twitter: *http://twitter.com/dkhaywood *sybase: * http://sybtraining.co.uk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos
Re: How to validate an entire object in a form (rather than a particular property of that object)
Hi Pedro, but my problem is that there is no form component to represent the form itself, is there? Any other thoughts? Dan On 19/04/2010 20:27, Pedro Santos wrote: Hi Dan On Mon, Apr 19, 2010 at 2:04 PM, Dan Haywood dkhayw...@gmail.com mailto:dkhayw...@gmail.com wrote: Another form-related question. I can see how to install a validator on a Form - Form#add(IFormValidator) - but it seems that AbstractFormValidator, the adapter, always requires a specific FormComponent to be specified in its error(...) method. How does one raise an error on the state of the form (and by implication, that of the underlying domain object) itself, without having to specify any form component? FeedbackMessages API, is expection an Component object as reporter. Maybe add the validation error to the form component will make sense: formComponent.getForm().error( theValidationErrorNotFormComponentSpecific ) An example would be the classic fromDate endDate. A workaround would be to install the validator on - say - the endDate. But I'm after a general solution, rather than a solution for this particular example. Thanks Dan -- Dan Haywood consultant, mentor, developer, author agile, ddd, oo, java, .net, sybase MA, MBCS, CITP, CEng /mail: /d...@haywood-associates.co.uk mailto:d...@haywood-associates.co.uk /phone: /+44 (0)7961 144286 /book: /Domain Driven Design using Naked Objects http://pragprog.com/titles/dhnako /blog: /http://danhaywood.com /linked in: /http://uk.linkedin.com/in/dkhaywood /twitter: /http://twitter.com/dkhaywood /sybase: /http://sybtraining.co.uk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org mailto:users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org mailto:users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to validate an entire object in a form (rather than a particular property of that object)
you can override form.onvalidate() and do your validation there -igor On Mon, Apr 19, 2010 at 4:51 PM, Dan Haywood dkhayw...@gmail.com wrote: Hi Pedro, but my problem is that there is no form component to represent the form itself, is there? Any other thoughts? Dan On 19/04/2010 20:27, Pedro Santos wrote: Hi Dan On Mon, Apr 19, 2010 at 2:04 PM, Dan Haywood dkhayw...@gmail.com wrote: Another form-related question. I can see how to install a validator on a Form - Form#add(IFormValidator) - but it seems that AbstractFormValidator, the adapter, always requires a specific FormComponent to be specified in its error(...) method. How does one raise an error on the state of the form (and by implication, that of the underlying domain object) itself, without having to specify any form component? FeedbackMessages API, is expection an Component object as reporter. Maybe add the validation error to the form component will make sense: formComponent.getForm().error( theValidationErrorNotFormComponentSpecific ) An example would be the classic fromDate endDate. A workaround would be to install the validator on - say - the endDate. But I'm after a general solution, rather than a solution for this particular example. Thanks Dan -- Dan Haywood consultant, mentor, developer, author agile, ddd, oo, java, .net, sybase MA, MBCS, CITP, CEng *mail: * d...@haywood-associates.co.uk *phone: *+44 (0)7961 144286 *book: *Domain Driven Design using Naked Objects http://pragprog.com/titles/dhnako *blog: *http://danhaywood.com *linked in: *http://uk.linkedin.com/in/dkhaywood *twitter: *http://twitter.com/dkhaywood *sybase: * http://sybtraining.co.uk - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Pedro Henrique Oliveira dos Santos - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org