On Apr 30, 2010, at 6:41 AM, Scott Gray wrote:

Is there an opportunity to plug-in a server-side validation service on any ModalForm? Has this been discussed before from you knowledge (excuse my
lack of search).  The theory would be that your dynamically generated
ModelForm instance could apply this validation service to the model. The RequestHandler on post-back could determine the ModelForm and execute any
defined validation service (if technically feasible).

What you could perhaps do is make sure you use services as your request map events and then create a special request/event that you can call via ajax that will valid the parameters against the service definition by serializing the form and telling it what your target request is. There is a seldom used child element to service -> attribute called type-validate which can allow you to do custom field level validation on incoming parameters. You just need to call modelService.validate(parameters, "IN", locale) in your special validation request/event and you're done.

Regards
Scott

What I am getting at here is an ability to model a "validation service" as part of the ModalForm. How it is implemented (sever-side vs. ajax callback) would really be secondary. I like the ajax approach for the validation that you have suggested in the implementation ... I was just thinking if you were going to add validation logic to your survey you could expose that through an extension to the ModelForm (since that is what survey is creating dynamically) and then we would have an ability that could be leveraged in a number of spots. This would be versus having a survey validation service that your survey handler happens to call first before the async execution service.

Reply via email to